From: 박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 Date: Wed, 9 Oct 2019 22:07:12 +0000 (+0900) Subject: [moco-tf] Introduce node_shape_with_check helper (#7993) X-Git-Tag: submit/tizen/20191205.083104~899 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=794017fa4d106188f46fb58ac6a18984e28e2e5d;p=platform%2Fcore%2Fml%2Fnnfw.git [moco-tf] Introduce node_shape_with_check helper (#7993) This will introduce node_shape_with_check() helper in TFShapeInferenceRule for getting node_shape of a node and revise for TFBiasAdd node Signed-off-by: SaeHie Park --- diff --git a/compiler/moco-tf/src/Dialect/TFShapeInferenceRule.cpp b/compiler/moco-tf/src/Dialect/TFShapeInferenceRule.cpp index 8e7b584..3ddf8f4 100644 --- a/compiler/moco-tf/src/Dialect/TFShapeInferenceRule.cpp +++ b/compiler/moco-tf/src/Dialect/TFShapeInferenceRule.cpp @@ -64,6 +64,14 @@ private: return sum_shape; } + loco::NodeShape node_shape_with_check(const moco::tf::TFNode::Node *node) + { + auto nodeshape = node_shape(node); + assert(nodeshape.domain() == loco::Domain::Tensor); + + return nodeshape; + } + bool valid_scala_value(moco::tf::TFConst *node) { auto nodeshape = node_shape(node); @@ -122,10 +130,7 @@ public: loco::NodeShape visit(const moco::tf::TFBiasAdd *node) final { - auto value_shape = node_shape(node->value()); - assert(value_shape.domain() != loco::Domain::Unknown); - - return value_shape; + return node_shape_with_check(node->value()); } loco::NodeShape visit(const moco::tf::TFConcatV2 *node) final