[moco-tf] Move vector<int64_t> streamout to LogHelper (#5981)
author박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Mon, 29 Jul 2019 23:31:35 +0000 (08:31 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Mon, 29 Jul 2019 23:31:35 +0000 (08:31 +0900)
This will move vector<int64_t> streamout of TFFormattedGraph to LogHelper

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
compiler/moco-tf/src/LogHelper.cpp
compiler/moco-tf/src/LogHelper.h
compiler/moco-tf/src/TFFormattedGraph.cpp

index a017f6b..04a4fb0 100644 (file)
@@ -47,3 +47,12 @@ std::ostream &operator<<(std::ostream &os, const loco::TensorShape &tensor_shape
 }
 
 } // namespace loco
+
+std::ostream &operator<<(std::ostream &os, const std::vector<int64_t> &vi64)
+{
+  for (auto vi : vi64)
+  {
+    os << vi << " ";
+  }
+  return os;
+}
index 921d72f..439d856 100644 (file)
@@ -22,6 +22,7 @@
 #include <loco/IR/TensorShape.h>
 
 #include <sstream>
+#include <vector>
 
 namespace loco
 {
@@ -43,4 +44,9 @@ std::ostream &operator<<(std::ostream &os, const loco::TensorShape &tensor_shape
 
 } // namespace loco
 
+/**
+ * @brief dump std::vector<int64_t> values to stream
+ */
+std::ostream &operator<<(std::ostream &os, const std::vector<int64_t> &vi64);
+
 #endif // __LOG_HELPER_H__
index 2220498..10b5fa0 100644 (file)
@@ -21,6 +21,8 @@
 #include "Dialect/TFDialect.h"
 #include "Dialect/TFNodes.h"
 
+#include "LogHelper.h"
+
 #include <sstream>
 
 namespace
@@ -137,15 +139,6 @@ bool TFNodeSummaryBuilder::summary(const TFConst *node, locop::NodeSummary &s) c
   return true;
 }
 
-std::ostream &operator<<(std::ostream &os, const std::vector<int64_t> &vi64)
-{
-  for (auto vi : vi64)
-  {
-    os << vi << " ";
-  }
-  return os;
-}
-
 bool TFNodeSummaryBuilder::summary(const TFConv2D *node, locop::NodeSummary &s) const
 {
   std::ostringstream ss;