[exo.tflite] Restrict TypeContext's visibility (#4159)
author박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Wed, 10 Jul 2019 03:59:12 +0000 (12:59 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Wed, 10 Jul 2019 03:59:12 +0000 (12:59 +0900)
TypeInference is the only module that accesses TypeContext.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
contrib/exo-tflite/src/ExporterUtils.h
contrib/exo-tflite/src/TypeInference.cpp

index 4cb3626..054b560 100644 (file)
@@ -48,14 +48,6 @@ struct ShapeDescription
 };
 
 /**
- * @brief Record the data type of each loco node
- */
-struct TypeContext
-{
-  std::unordered_map<loco::Node *, tflite::TensorType> _node_to_type;
-};
-
-/**
  * @brief Record the (tensor) shape of each loco node
  */
 struct ShapeContext
@@ -77,7 +69,7 @@ struct SubGraphContext
 };
 
 // Prerequisites for tflite::Model object creation
-struct SerializedModelData final : public ShapeContext, public TypeContext, public SubGraphContext
+struct SerializedModelData final : public ShapeContext, public SubGraphContext
 {
   SerializedModelData() = default;
   SerializedModelData(const SerializedModelData &) = delete;
index b4e693f..904b600 100644 (file)
@@ -62,6 +62,14 @@ T ceil_div(T dividend, T divisor)
   return (dividend + divisor - 1) / divisor;
 }
 
+/**
+ * @brief Record the data type of each loco node
+ */
+struct TypeContext
+{
+  std::unordered_map<loco::Node *, tflite::TensorType> _node_to_type;
+};
+
 } // namespace
 
 tflite::TensorType getOpResultType(loco::ConstGen *node, TypeContext &)