From 7c1909561b2ebbf9a7291b23aca185aee8f1d0c3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EB=B0=95=EC=84=B8=ED=9D=AC/On-Device=20Lab=28SR=29/Princip?= =?utf8?q?al=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Mon, 5 Aug 2019 13:01:21 +0900 Subject: [PATCH] [moco-tf] LogHelper to dump Pad and PadData (#6185) This will introduce LogHelper to dump Pad and PadData values Signed-off-by: SaeHie Park --- compiler/moco-tf/src/LogHelper.cpp | 24 ++++++++++++++++++++++++ compiler/moco-tf/src/LogHelper.h | 20 ++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/compiler/moco-tf/src/LogHelper.cpp b/compiler/moco-tf/src/LogHelper.cpp index e9d50ab..a487d17 100644 --- a/compiler/moco-tf/src/LogHelper.cpp +++ b/compiler/moco-tf/src/LogHelper.cpp @@ -46,8 +46,32 @@ std::ostream &operator<<(std::ostream &os, const loco::TensorShape &tensor_shape return os; } +std::ostream &operator<<(std::ostream &os, const loco::Pad<2> &pad) +{ + os << "[TLBR " << pad.top() << "," << pad.left() << "," << pad.bottom() << "," << pad.right() + << "]"; + + return os; +} + } // namespace loco +namespace moco +{ +namespace tf +{ + +std::ostream &operator<<(std::ostream &os, const moco::tf::PadData &pad_data) +{ + os << "[TLBR " << pad_data.pad()->top() << "," << pad_data.pad()->left() << "," + << pad_data.pad()->bottom() << "," << pad_data.pad()->right() << "]"; + + return os; +} + +} // namespace tf +} // namespace moco + std::ostream &operator<<(std::ostream &os, const std::vector &vi64) { for (auto vi : vi64) diff --git a/compiler/moco-tf/src/LogHelper.h b/compiler/moco-tf/src/LogHelper.h index 22d89f0..809ab7b 100644 --- a/compiler/moco-tf/src/LogHelper.h +++ b/compiler/moco-tf/src/LogHelper.h @@ -23,6 +23,8 @@ #include #include +#include "Annotations/PadData.h" + #include #include @@ -44,8 +46,26 @@ std::ostream &operator<<(std::ostream &os, const loco::FilterShape &filter_shape */ std::ostream &operator<<(std::ostream &os, const loco::TensorShape &tensor_shape); +/** + * @brief dump Pad<2> values to stream + */ +std::ostream &operator<<(std::ostream &os, const loco::Pad<2> &pad); + } // namespace loco +namespace moco +{ +namespace tf +{ + +/** + * @brief dump moco::tf::PadData + */ +std::ostream &operator<<(std::ostream &os, const moco::tf::PadData &pad_data); + +} // namespace tf +} // namespace moco + /** * @brief dump std::vector values to stream */ -- 2.7.4