[moco-tf] Do not reset input for Conv2D Canonicalizier (#6471)
author박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Mon, 12 Aug 2019 04:27:47 +0000 (13:27 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Mon, 12 Aug 2019 04:27:47 +0000 (13:27 +0900)
This will remove reset input for old replaced Conv2D node in Canonicalization and update the diagram

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

index f1ee526..18e6bc2 100644 (file)
@@ -109,7 +109,8 @@ bool canonicalize_conv2d(loco::Graph *graph, moco::tf::TFConv2D *node)
    *                 B -/
    *
    *       After
-   *                    - TFConv2D -
+   *                 A -- TFConv2D -
+   *                 B -/
    *                 A -- FeatureEncode - Conv2D - FeatureDecode - C
    *                 B -- FilterEncode -/
    *
@@ -118,6 +119,7 @@ bool canonicalize_conv2d(loco::Graph *graph, moco::tf::TFConv2D *node)
    *                 B : ker of TFConv2D
    *                 C : a node that uses TFConv2D as an input
    *                 TFConv2D is disconnected from other nodes
+   *                 A and B are drawn twice to simplify the diagram
    */
 
   auto data_layout = plier::tf::as_data_layout(node->data_layout());
@@ -157,10 +159,8 @@ bool canonicalize_conv2d(loco::Graph *graph, moco::tf::TFConv2D *node)
   conv2d->ker(filter_enc);
   feature_dec->input(conv2d);
 
-  // replace and disconnect old node
+  // replace old node
   replace(node).with(feature_dec);
-  node->ifm(nullptr);
-  node->ker(nullptr);
 
   return true;
 }