[loco] Do not invoke global shape_known helper (#7297)
author박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Tue, 10 Sep 2019 00:03:46 +0000 (09:03 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Tue, 10 Sep 2019 00:03:46 +0000 (09:03 +0900)
This commit revises ForwardShapeInferenceAlgorithm to invoke internal
"shape_known" helper instead of global shape_known helper.

This change reduces the amount of code changes for API v2 migration.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
compiler/loco/src/Service/CanonicalShapeInferenceRule.cpp

index 87e6084..5c0f92a 100644 (file)
@@ -170,6 +170,7 @@ loco::NodeShape eltwise_binary_node_shape(const loco::Node *node)
 class ForwardShapeInferenceAlgorithm final : public loco::CanonicalNodeVisitor<loco::NodeShape>
 {
 private:
+  bool shape_known(const loco::Node *node) const { return loco::shape_known(node); }
   loco::NodeShape node_shape(const loco::Node *node) const { return loco::shape_get(node); }
 
 public:
@@ -384,7 +385,7 @@ public:
   // CASE: Push
   loco::NodeShape visit(const loco::Push *node) final
   {
-    assert(loco::shape_known(node->from()));
+    assert(shape_known(node->from()));
     return node_shape(node->from());
   }