From a7720527e1b85d1e51ffbf40b9d5f842c8bdf6b5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EB=B0=95=EC=A2=85=ED=98=84/On-Device=20Lab=28SR=29/Staff?= =?utf8?q?=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Wed, 10 Jul 2019 12:59:12 +0900 Subject: [PATCH] [exo.tflite] Restrict TypeContext's visibility (#4159) TypeInference is the only module that accesses TypeContext. Signed-off-by: Jonghyun Park --- contrib/exo-tflite/src/ExporterUtils.h | 10 +--------- contrib/exo-tflite/src/TypeInference.cpp | 8 ++++++++ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/contrib/exo-tflite/src/ExporterUtils.h b/contrib/exo-tflite/src/ExporterUtils.h index 4cb3626..054b560 100644 --- a/contrib/exo-tflite/src/ExporterUtils.h +++ b/contrib/exo-tflite/src/ExporterUtils.h @@ -48,14 +48,6 @@ struct ShapeDescription }; /** - * @brief Record the data type of each loco node - */ -struct TypeContext -{ - std::unordered_map _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; diff --git a/contrib/exo-tflite/src/TypeInference.cpp b/contrib/exo-tflite/src/TypeInference.cpp index b4e693f..904b600 100644 --- a/contrib/exo-tflite/src/TypeInference.cpp +++ b/contrib/exo-tflite/src/TypeInference.cpp @@ -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 _node_to_type; +}; + } // namespace tflite::TensorType getOpResultType(loco::ConstGen *node, TypeContext &) -- 2.7.4