[moco/tf] Skip fix_shape for add when disconnected (#4282)
author박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Tue, 16 Jul 2019 01:28:01 +0000 (10:28 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Tue, 16 Jul 2019 01:28:01 +0000 (10:28 +0900)
This will skip fix_shape for TFAdd node when it's disconnected from some transformation

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

index b9efe1b..d396e23 100644 (file)
@@ -552,6 +552,12 @@ bool fix_shape(moco::tf::TFAdd *node)
 {
   auto x = node->x();
   auto y = node->y();
+  if (x == nullptr || y == nullptr)
+  {
+    // this node maybe disconnected by some transformation
+    // TODO remove this block after fixing to iterate only active nodes
+    return false;
+  }
   auto x_shapedata = x->annot<ShapeInferenceData>();
   auto y_shapedata = y->annot<ShapeInferenceData>();
   if (x_shapedata == nullptr || y_shapedata == nullptr)