[moco-tf] Run for active nodes for FixPad and FixShape (#5862)
author박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Thu, 25 Jul 2019 04:26:56 +0000 (13:26 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Thu, 25 Jul 2019 04:26:56 +0000 (13:26 +0900)
This will fix to run for active nodes from outputs for FixPadding and FixShape transformations

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
compiler/moco-tf/src/Transforms/FixPaddingTransform.cpp
compiler/moco-tf/src/Transforms/FixShapeTransform.cpp

index e7d520b..6af16e9 100644 (file)
@@ -485,7 +485,7 @@ namespace tf
 bool FixPaddingTransform::run(loco::Graph *graph)
 {
   bool changed = false;
-  for (auto node : loco::all_nodes(graph))
+  for (auto node : loco::active_nodes(loco::output_nodes(graph)))
   {
 // clang-format off
 #define CANONICAL_NODE(TYPE_NAME)                       \
index 415ef62..69003af 100644 (file)
@@ -765,7 +765,7 @@ namespace tf
 bool FixShapeTransform::run(loco::Graph *graph)
 {
   bool changed = false;
-  for (auto node : loco::all_nodes(graph))
+  for (auto node : loco::active_nodes(loco::output_nodes(graph)))
   {
 // clang-format off
 #define CANONICAL_NODE(TYPE_NAME)                     \