From 2fe5364e8b90681295becb7f48819668f40136a2 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: Tue, 16 Jul 2019 10:28:01 +0900 Subject: [PATCH] [moco/tf] Skip fix_shape for add when disconnected (#4282) This will skip fix_shape for TFAdd node when it's disconnected from some transformation Signed-off-by: SaeHie Park --- contrib/moco-tf/src/Transforms/FixShapeTransform.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/contrib/moco-tf/src/Transforms/FixShapeTransform.cpp b/contrib/moco-tf/src/Transforms/FixShapeTransform.cpp index b9efe1b..d396e23 100644 --- a/contrib/moco-tf/src/Transforms/FixShapeTransform.cpp +++ b/contrib/moco-tf/src/Transforms/FixShapeTransform.cpp @@ -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(); auto y_shapedata = y->annot(); if (x_shapedata == nullptr || y_shapedata == nullptr) -- 2.7.4