Update namespace and ifdef for tflite library (#3968)
author오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Wed, 12 Dec 2018 08:39:07 +0000 (17:39 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Wed, 12 Dec 2018 08:39:07 +0000 (17:39 +0900)
* Update namespace and ifdef for tflite library

Make tflite/extend directory for ported codes from public tensorflow
Update namespace except extended directory
Update ifdef in header

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
* Rename tflite/extend to tflite/ext

* Fix format

* Update ifdef in ext

* Flatten namespace nnfw::tflite::interp to nnfw::tflite

* Add comment for endif

46 files changed:
contrib/tf_test/tf_test.cpp
contrib/tflite_classify/src/InferenceInterface.cc
contrib/tflite_classify/src/InferenceInterface.h
libs/tflite/include/tflite/Assert.h
libs/tflite/include/tflite/Diff.h
libs/tflite/include/tflite/FeatureView.h
libs/tflite/include/tflite/InputIndex.h
libs/tflite/include/tflite/InterpreterSession.h
libs/tflite/include/tflite/NNAPISession.h
libs/tflite/include/tflite/OutputIndex.h
libs/tflite/include/tflite/Quantization.h
libs/tflite/include/tflite/Session.h
libs/tflite/include/tflite/TensorLogger.h
libs/tflite/include/tflite/TensorShapeUtils.h
libs/tflite/include/tflite/TensorUtils.h
libs/tflite/include/tflite/TensorView.h
libs/tflite/include/tflite/ext/kernels/Abs.h [moved from libs/tflite/include/tflite/kernels/Abs.h with 89% similarity]
libs/tflite/include/tflite/ext/kernels/CustomOps.h [moved from libs/tflite/include/tflite/kernels/CustomOps.h with 84% similarity]
libs/tflite/include/tflite/ext/kernels/SquaredDifference.h [moved from libs/tflite/include/tflite/kernels/SquaredDifference.h with 92% similarity]
libs/tflite/include/tflite/ext/kernels/TensorFlowMax.h [moved from libs/tflite/include/tflite/kernels/TensorFlowMax.h with 93% similarity]
libs/tflite/include/tflite/ext/kernels/TensorFlowSum.h [moved from libs/tflite/include/tflite/kernels/TensorFlowSum.h with 88% similarity]
libs/tflite/include/tflite/ext/kernels/register.h [moved from libs/tflite/include/tflite/kernels/register.h with 89% similarity]
libs/tflite/include/tflite/ext/nnapi_delegate.h [moved from libs/tflite/include/tflite/nnapi_delegate.h with 93% similarity]
libs/tflite/include/tflite/interp/Builder.h
libs/tflite/include/tflite/interp/FlatBufferBuilder.h
libs/tflite/include/tflite/interp/FunctionBuilder.h
libs/tflite/src/Diff.cpp
libs/tflite/src/FeatureView.cpp
libs/tflite/src/TensorShapeUtils.cpp
libs/tflite/src/TensorView.test.cpp
libs/tflite/src/ext/kernels/Abs.cpp [moved from libs/tflite/src/kernels/Abs.cpp with 98% similarity]
libs/tflite/src/ext/kernels/SquaredDifference.cpp [moved from libs/tflite/src/kernels/SquaredDifference.cpp with 98% similarity]
libs/tflite/src/ext/kernels/TensorFlowMax.cpp [moved from libs/tflite/src/kernels/TensorFlowMax.cpp with 99% similarity]
libs/tflite/src/ext/kernels/TensorFlowSum.cpp [moved from libs/tflite/src/kernels/TensorFlowSum.cpp with 99% similarity]
libs/tflite/src/ext/kernels/register.cpp [moved from libs/tflite/src/kernels/register.cpp with 99% similarity]
libs/tflite/src/ext/nnapi_delegate.cpp [moved from libs/tflite/src/nnapi_delegate.cpp with 99% similarity]
libs/tflite/src/ext/nnapi_delegate_ex_AddOpsAndParams_lambda.inc [moved from libs/tflite/src/nnapi_delegate_ex_AddOpsAndParams_lambda.inc with 100% similarity]
libs/tflite/src/interp/FlatBufferBuilder.cpp
libs/tflite/src/interp/FunctionBuilder.cpp
tools/nnapi_test/src/nnapi_test.cc
tools/tflite_benchmark/src/tflite_benchmark.cc
tools/tflite_benchmark_model/benchmark_tflite_model.cc
tools/tflite_examples/src/conv.cpp
tools/tflite_run/src/tensor_loader.cc
tools/tflite_run/src/tensor_loader.h
tools/tflite_run/src/tflite_run.cc

index 56ec1d2..20c5c58 100644 (file)
@@ -21,7 +21,7 @@
 #include "tflite/Session.h"
 #include "tflite/InterpreterSession.h"
 #include "tflite/NNAPISession.h"
-#include "tflite/kernels/register.h"
+#include "tflite/ext/kernels/register.h"
 
 #include "util/fp32.h"
 
@@ -114,15 +114,15 @@ int main(int argc, char **argv)
   auto lite_model = BuildModelFromFile(lite_model_path);
   auto lite_interp = BuildInterpFromModel(lite_model);
 
-  std::shared_ptr<nnfw::support::tflite::Session> lite_sess;
+  std::shared_ptr<nnfw::tflite::Session> lite_sess;
 
   if (use_nnapi)
   {
-    lite_sess = std::make_shared<nnfw::support::tflite::NNAPISession>(lite_interp.get());
+    lite_sess = std::make_shared<nnfw::tflite::NNAPISession>(lite_interp.get());
   }
   else
   {
-    lite_sess = std::make_shared<nnfw::support::tflite::InterpreterSession>(lite_interp.get());
+    lite_sess = std::make_shared<nnfw::tflite::InterpreterSession>(lite_interp.get());
   }
 
   //
index 27d3382..1609434 100644 (file)
@@ -31,11 +31,11 @@ InferenceInterface::InferenceInterface(const std::string &model_file, const bool
 
   if (use_nnapi)
   {
-    _sess = std::make_shared<nnfw::support::tflite::NNAPISession>(_interpreter.get());
+    _sess = std::make_shared<nnfw::tflite::NNAPISession>(_interpreter.get());
   }
   else
   {
-    _sess = std::make_shared<nnfw::support::tflite::InterpreterSession>(_interpreter.get());
+    _sess = std::make_shared<nnfw::tflite::InterpreterSession>(_interpreter.get());
   }
 
   _sess->prepare();
index b15a044..06ebb3d 100644 (file)
@@ -23,7 +23,7 @@
 #ifndef __TFLITE_CLASSIFY_INFERENCE_INTERFACE_H__
 #define __TFLITE_CLASSIFY_INFERENCE_INTERFACE_H__
 
-#include "tflite/kernels/register.h"
+#include "tflite/ext/kernels/register.h"
 #include "tensorflow/contrib/lite/model.h"
 
 #include "tflite/InterpreterSession.h"
@@ -87,7 +87,7 @@ public:
 private:
   std::unique_ptr<tflite::Interpreter> _interpreter;
   std::unique_ptr<tflite::FlatBufferModel> _model;
-  std::shared_ptr<nnfw::support::tflite::Session> _sess;
+  std::shared_ptr<nnfw::tflite::Session> _sess;
 };
 
 #endif // __TFLITE_CLASSIFY_INFERENCE_INTERFACE_H__
index ee19568..6d12d37 100644 (file)
@@ -20,8 +20,8 @@
  * @ingroup  COM_AI_RUNTIME
  */
 
-#ifndef __NNFW_SUPPORT_TFLITE_ASSERT_H__
-#define __NNFW_SUPPORT_TFLITE_ASSERT_H__
+#ifndef __NNFW_TFLITE_ASSERT_H__
+#define __NNFW_TFLITE_ASSERT_H__
 
 #include "tensorflow/contrib/lite/context.h"
 
@@ -42,4 +42,4 @@
     }                                                                  \
   }
 
-#endif // __NNFW_SUPPORT_TFLITE_ASSERT_H__
+#endif // __NNFW_TFLITE_ASSERT_H__
index 45b7c9e..dc24964 100644 (file)
@@ -20,8 +20,8 @@
  * @ingroup  COM_AI_RUNTIME
  */
 
-#ifndef __NNFW_SUPPORT_TFLITE_COMPARE_H__
-#define __NNFW_SUPPORT_TFLITE_COMPARE_H__
+#ifndef __NNFW_TFLITE_DIFF_H__
+#define __NNFW_TFLITE_DIFF_H__
 
 #include "tensorflow/contrib/lite/interpreter.h"
 
@@ -77,8 +77,8 @@ public:
    * @return  @c true if two TensorView values are same, otherwise @c false
    */
   template <typename T>
-  bool compareSingleTensorView(const nnfw::support::tflite::TensorView<T> &expected,
-                               const nnfw::support::tflite::TensorView<T> &obtained, int id) const;
+  bool compareSingleTensorView(const nnfw::tflite::TensorView<T> &expected,
+                               const nnfw::tflite::TensorView<T> &obtained, int id) const;
 
 private:
   const nnfw::util::tensor::Comparator &_comparator;
@@ -174,7 +174,7 @@ public:
    * @param[in] builder  Interpreter Builder used to run
    * @return 0 if test succeeds, otherwise failure
    */
-  int run(const nnfw::support::tflite::interp::Builder &builder);
+  int run(const nnfw::tflite::Builder &builder);
 
 public:
   /**
@@ -196,4 +196,4 @@ public:
   static RandomTestRunner make(int seed);
 };
 
-#endif // __NNFW_SUPPORT_TFLITE_COMPARE_H__
+#endif // __NNFW_TFLITE_DIFF_H__
index b7266ca..992d26b 100644 (file)
@@ -20,8 +20,8 @@
  * @ingroup  COM_AI_RUNTIME
  */
 
-#ifndef __NNFW_SUPPORT_TFLITE_FEATURE_VIEW_H__
-#define __NNFW_SUPPORT_TFLITE_FEATURE_VIEW_H__
+#ifndef __NNFW_TFLITE_FEATURE_VIEW_H__
+#define __NNFW_TFLITE_FEATURE_VIEW_H__
 
 #include "tensorflow/contrib/lite/interpreter.h"
 
@@ -33,8 +33,6 @@
 
 namespace nnfw
 {
-namespace support
-{
 namespace tflite
 {
 
@@ -103,7 +101,6 @@ private:
 };
 
 } // namespace tflite
-} // namespace support
 } // namespace nnfw
 
-#endif // __NNFW_SUPPORT_TFLITE_FEATURE_VIEW_H__
+#endif // __NNFW_TFLITE_FEATURE_VIEW_H__
index 3c66885..f535b26 100644 (file)
  * @ingroup  COM_AI_RUNTIME
  */
 
-#ifndef __NNFW_SUPPORT_TFLITE_INPUT_INDEX_H__
-#define __NNFW_SUPPORT_TFLITE_INPUT_INDEX_H__
+#ifndef __NNFW_TFLITE_INPUT_INDEX_H__
+#define __NNFW_TFLITE_INPUT_INDEX_H__
 
 namespace nnfw
 {
-namespace support
-{
 namespace tflite
 {
 
@@ -57,7 +55,6 @@ private:
 };
 
 } // namespace tflite
-} // namespace support
 } // namespace nnfw
 
-#endif // __NNFW_SUPPORT_TFLITE_INPUT_INDEX_H__
+#endif // __NNFW_TFLITE_INPUT_INDEX_H__
index 70bac22..deaf05a 100644 (file)
  * @ingroup  COM_AI_RUNTIME
  */
 
-#ifndef __NNFW_SUPPORT_TFLITE_INTERPRETER_SESSION_H__
-#define __NNFW_SUPPORT_TFLITE_INTERPRETER_SESSION_H__
+#ifndef __NNFW_TFLITE_INTERPRETER_SESSION_H__
+#define __NNFW_TFLITE_INTERPRETER_SESSION_H__
 
 #include "Session.h"
 
 namespace nnfw
 {
-namespace support
-{
 namespace tflite
 {
 
@@ -96,7 +94,6 @@ private:
 };
 
 } // namespace tflite
-} // namespace support
 } // namespace nnfw
 
-#endif // __NNFW_SUPPORT_TFLITE_INTERPRETER_SESSION_H__
+#endif // __NNFW_TFLITE_INTERPRETER_SESSION_H__
index 1c5e501..ec9fbd8 100644 (file)
  * @ingroup  COM_AI_RUNTIME
  */
 
-#ifndef __NNFW_SUPPORT_TFLITE_NNAPI_SESSION_H__
-#define __NNFW_SUPPORT_TFLITE_NNAPI_SESSION_H__
+#ifndef __NNFW_TFLITE_NNAPI_SESSION_H__
+#define __NNFW_TFLITE_NNAPI_SESSION_H__
 
 #include "Session.h"
-#include "tflite/nnapi_delegate.h"
+#include "tflite/ext/nnapi_delegate.h"
 
 namespace nnfw
 {
-namespace support
-{
 namespace tflite
 {
 
@@ -98,7 +96,6 @@ private:
 };
 
 } // namespace tflite
-} // namespace support
 } // namespace nnfw
 
-#endif // __NNFW_SUPPORT_TFLITE_NNAPI_SESSION_H__
+#endif // __NNFW_TFLITE_NNAPI_SESSION_H__
index d438416..dd1ca8d 100644 (file)
  * @ingroup  COM_AI_RUNTIME
  */
 
-#ifndef __NNFW_SUPPORT_TFLITE_OUTPUT_INDEX_H__
-#define __NNFW_SUPPORT_TFLITE_OUTPUT_INDEX_H__
+#ifndef __NNFW_TFLITE_OUTPUT_INDEX_H__
+#define __NNFW_TFLITE_OUTPUT_INDEX_H__
 
 namespace nnfw
 {
-namespace support
-{
 namespace tflite
 {
 
@@ -57,7 +55,6 @@ private:
 };
 
 } // namespace tflite
-} // namespace support
 } // namespace nnfw
 
-#endif // __NNFW_SUPPORT_TFLITE_OUTPUT_INDEX_H__
+#endif // __NNFW_TFLITE_OUTPUT_INDEX_H__
index fb1b675..4a8a0f1 100644 (file)
@@ -20,8 +20,8 @@
  * @ingroup  COM_AI_RUNTIME
  */
 
-#ifndef __NNFW_SUPPORT_TFLITE_QUANTIZATION_H__
-#define __NNFW_SUPPORT_TFLITE_QUANTIZATION_H__
+#ifndef __NNFW_TFLITE_QUANTIZATION_H__
+#define __NNFW_TFLITE_QUANTIZATION_H__
 
 /**
  * @brief Union to provide bitwise conversion of integer and float
@@ -41,4 +41,4 @@ static const float FLOAT_NEAREST_TO_1 = BitwiseIntToFloat{0x3f7fffff}.f;
  */
 TfLiteQuantizationParams make_default_quantization(void);
 
-#endif // __NNFW_SUPPORT_TFLITE_QUANTIZATION_H__
+#endif // __NNFW_TFLITE_QUANTIZATION_H__
index 0385208..4f2e5c5 100644 (file)
  * @ingroup  COM_AI_RUNTIME
  */
 
-#ifndef __NNFW_SUPPORT_TFLITE_SESSION_H__
-#define __NNFW_SUPPORT_TFLITE_SESSION_H__
+#ifndef __NNFW_TFLITE_SESSION_H__
+#define __NNFW_TFLITE_SESSION_H__
 
 #include <tensorflow/contrib/lite/interpreter.h>
 
 namespace nnfw
 {
-namespace support
-{
 namespace tflite
 {
 
@@ -66,7 +64,6 @@ struct Session
 };
 
 } // namespace tflite
-} // namespace support
 } // namespace nnfw
 
-#endif // __NNFW_SUPPORT_TFLITE_INTERP_SESSION_H__
+#endif // __NNFW_TFLITE_INTERP_SESSION_H__
index 9af5ffe..d5e19c7 100644 (file)
@@ -20,8 +20,8 @@
  * @ingroup  COM_AI_RUNTIME
  */
 
-#ifndef __NNFW_SUPPORT_TFLITE_TENSOR_LOGGER_H__
-#define __NNFW_SUPPORT_TFLITE_TENSOR_LOGGER_H__
+#ifndef __NNFW_TFLITE_TENSOR_LOGGER_H__
+#define __NNFW_TFLITE_TENSOR_LOGGER_H__
 
 #include "util/tensor/IndexIterator.h"
 #include "tflite/TensorView.h"
@@ -33,8 +33,6 @@
 
 namespace nnfw
 {
-namespace support
-{
 namespace tflite
 {
 
@@ -165,7 +163,6 @@ private:
 };
 
 } // namespace tflite
-} // namespace support
 } // namespace nnfw
 
-#endif // __NNFW_SUPPORT_TFLITE_TENSOR_LOGGER_H__
+#endif // __NNFW_TFLITE_TENSOR_LOGGER_H__
index 99b90e9..7a3f72d 100644 (file)
@@ -20,8 +20,8 @@
  * @ingroup  COM_AI_RUNTIME
  */
 
-#ifndef __NNFW_SUPPORT_TFLITE_TENSOR_SHAPE_UTILS_H__
-#define __NNFW_SUPPORT_TFLITE_TENSOR_SHAPE_UTILS_H__
+#ifndef __NNFW_TFLITE_TENSOR_SHAPE_UTILS_H__
+#define __NNFW_TFLITE_TENSOR_SHAPE_UTILS_H__
 
 #include "util/tensor/Shape.h"
 
@@ -29,8 +29,6 @@
 
 namespace nnfw
 {
-namespace support
-{
 namespace tflite
 {
 
@@ -61,7 +59,6 @@ nnfw::util::tensor::Shape broadcast(const nnfw::util::tensor::Shape &lhs_shape,
                                     const nnfw::util::tensor::Shape &rhs_shape);
 
 } // namespace tflite
-} // namespace support
 } // namespace nnfw
 
-#endif // __NNFW_SUPPORT_TFLITE_TENSOR_SHAPE_UTILS_H__
+#endif // __NNFW_TFLITE_TENSOR_SHAPE_UTILS_H__
index b454453..6266c5d 100644 (file)
  * @ingroup COM_AI_RUNTIME
  */
 
-#ifndef __NNFW_SUPPORT_TFLITE_TENSOR_UTILS_H__
-#define __NNFW_SUPPORT_TFLITE_TENSOR_UTILS_H__
+#ifndef __NNFW_TFLITE_TENSOR_UTILS_H__
+#define __NNFW_TFLITE_TENSOR_UTILS_H__
 
 #include <tensorflow/contrib/lite/context.h>
 
 namespace nnfw
 {
-namespace support
-{
 namespace tflite
 {
 
@@ -51,7 +49,6 @@ inline bool isFeatureTensor(const TfLiteTensor *tensor)
 }
 
 } // namespace tflite
-} // namespace support
 } // namespace nnfw
 
-#endif // __NNFW_SUPPORT_TFLITE_TENSOR_UTILS_H__
+#endif // __NNFW_TFLITE_TENSOR_UTILS_H__
index 97216e4..3e0c2fb 100644 (file)
@@ -20,8 +20,8 @@
  * @ingroup  COM_AI_RUNTIME
  */
 
-#ifndef __NNFW_SUPPORT_TFLITE_TENSOR_VIEW_H__
-#define __NNFW_SUPPORT_TFLITE_TENSOR_VIEW_H__
+#ifndef __NNFW_TFLITE_TENSOR_VIEW_H__
+#define __NNFW_TFLITE_TENSOR_VIEW_H__
 
 #include "tensorflow/contrib/lite/interpreter.h"
 
@@ -32,8 +32,6 @@
 
 namespace nnfw
 {
-namespace support
-{
 namespace tflite
 {
 
@@ -117,7 +115,6 @@ public:
 };
 
 } // namespace tflite
-} // namespace support
 } // namespace nnfw
 
-#endif // __NNFW_SUPPORT_TFLITE_TENSOR_VIEW_H__
+#endif // __NNFW_TFLITE_TENSOR_VIEW_H__
similarity index 89%
rename from libs/tflite/include/tflite/kernels/Abs.h
rename to libs/tflite/include/tflite/ext/kernels/Abs.h
index aaf96ae..4ea8569 100644 (file)
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef __NNFW_SUPPORT_TFLITE_KERNELS_ABS_H__
-#define __NNFW_SUPPORT_TFLITE_KERNELS_ABS_H__
+#ifndef __NNFW_TFLITE_EXT_KERNELS_ABS_H__
+#define __NNFW_TFLITE_EXT_KERNELS_ABS_H__
 
 #include "tensorflow/contrib/lite/context.h"
 
@@ -41,4 +41,4 @@ TfLiteStatus EvalAbs(TfLiteContext *context, TfLiteNode *node);
 } // namespace ops
 } // namespace tflite
 
-#endif
+#endif // __NNFW_TFLITE_EXT_KERNELS_ABS_H__
  * @ingroup  COM_AI_RUNTIME
  */
 
-#ifndef __NNFW_SUPPORT_TFLITE_KERNELS_CUSTOM_OP_H__
-#define __NNFW_SUPPORT_TFLITE_KERNELS_CUSTOM_OP_H__
+#ifndef __NNFW_TFLITE_EXT_KERNELS_CUSTOM_OP_H__
+#define __NNFW_TFLITE_EXT_KERNELS_CUSTOM_OP_H__
 
 #include "tensorflow/contrib/lite/context.h"
-#include "tflite/kernels/TensorFlowMax.h"
-#include "tflite/kernels/SquaredDifference.h"
-#include "tflite/kernels/TensorFlowSum.h"
-#include "tflite/kernels/Abs.h"
+#include "tflite/ext/kernels/TensorFlowMax.h"
+#include "tflite/ext/kernels/SquaredDifference.h"
+#include "tflite/ext/kernels/TensorFlowSum.h"
+#include "tflite/ext/kernels/Abs.h"
 
 namespace tflite
 {
@@ -60,4 +60,4 @@ REGISTER_FUNCTION(Abs)
 } // namespace ops
 } // namespace tflite
 
-#endif // __NNFW_SUPPORT_TFLITE_KERNELS_CUSTOM_OP_H__
+#endif // __NNFW_TFLITE_EXT_KERNELS_CUSTOM_OP_H__
@@ -21,8 +21,8 @@
  * @ingroup  COM_AI_RUNTIME
  */
 
-#ifndef __NNFW_SUPPORT_TFLITE_KERNELS_SQUARED_DIFFERENCE_H__
-#define __NNFW_SUPPORT_TFLITE_KERNELS_SQUARED_DIFFERENCE_H__
+#ifndef __NNFW_TFLITE_EXT_KERNELS_SQUARED_DIFFERENCE_H__
+#define __NNFW_TFLITE_EXT_KERNELS_SQUARED_DIFFERENCE_H__
 
 #include "tensorflow/contrib/lite/context.h"
 
@@ -76,4 +76,4 @@ TfLiteStatus EvalSquaredDifference(TfLiteContext *context, TfLiteNode *node);
 } // namespace ops
 } // namespace tflite
 
-#endif
+#endif // __NNFW_TFLITE_EXT_KERNELS_SQUARED_DIFFERENCE_H__
@@ -20,8 +20,8 @@
  * @ingroup  COM_AI_RUNTIME
  */
 
-#ifndef __NNFW_SUPPORT_TFLITE_KERNELS_TENSORFLOW_MAX_H__
-#define __NNFW_SUPPORT_TFLITE_KERNELS_TENSORFLOW_MAX_H__
+#ifndef __NNFW_TFLITE_EXT_KERNELS_TENSORFLOW_MAX_H__
+#define __NNFW_TFLITE_EXT_KERNELS_TENSORFLOW_MAX_H__
 
 #include "tensorflow/contrib/lite/context.h"
 
@@ -75,4 +75,4 @@ TfLiteStatus EvalTensorFlowMax(TfLiteContext *context, TfLiteNode *node);
 } // namespace ops
 } // namespace tflite
 
-#endif
+#endif // __NNFW_TFLITE_EXT_KERNELS_TENSORFLOW_MAX_H__
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef __NNFW_SUPPORT_TFLITE_KERNELS_TENSORFLOW_SUM_H__
-#define __NNFW_SUPPORT_TFLITE_KERNELS_TENSORFLOW_SUM_H__
+#ifndef __NNFW_TFLITE_EXT_KERNELS_TENSORFLOW_SUM_H__
+#define __NNFW_TFLITE_EXT_KERNELS_TENSORFLOW_SUM_H__
 
 #include "tensorflow/contrib/lite/context.h"
 
@@ -41,4 +41,4 @@ TfLiteStatus EvalTensorFlowSum(TfLiteContext *context, TfLiteNode *node);
 } // namespace ops
 } // namespace tflite
 
-#endif
+#endif // __NNFW_TFLITE_EXT_KERNELS_TENSORFLOW_SUM_H__
@@ -19,8 +19,8 @@ limitations under the License.
 
 // NOTE This header is derived from the following file (in TensorFlow)
 //        'externals/tensorflow/tensorflow/contrib/lite/kernels/register.h'
-#ifndef __NNFW_SUPPORT_TFLITE_KERNELS_REGISTER_H__
-#define __NNFW_SUPPORT_TFLITE_KERNELS_REGISTER_H__
+#ifndef __NNFW_TFLITE_EXT_KERNELS_REGISTER_H__
+#define __NNFW_TFLITE_EXT_KERNELS_REGISTER_H__
 
 #include <unordered_map>
 #include "tensorflow/contrib/lite/context.h"
@@ -40,6 +40,6 @@ class BuiltinOpResolver : public MutableOpResolver {
 }  // namespace ops
 }  // namespace tflite
 
-#endif // __NNFW_SUPPORT_TFLITE_KERNELS_REGISTER_H__
+#endif // __NNFW_TFLITE_EXT_KERNELS_REGISTER_H__
 
 // clang-format on
@@ -19,8 +19,8 @@ limitations under the License.
 
 // NOTE This header is derived from the following file (in TensorFlow v1.12)
 //        'externals/tensorflow/tensorflow/contrib/lite/nnapi_delegate.h'
-#ifndef __NNFW_SUPPORT_TFLITE_NNAPI_DELEGATE_H__
-#define __NNFW_SUPPORT_TFLITE_NNAPI_DELEGATE_H__
+#ifndef __NNFW_TFLITE_EXT_NNAPI_DELEGATE_H__
+#define __NNFW_TFLITE_EXT_NNAPI_DELEGATE_H__
 
 #include "tensorflow/contrib/lite/allocation.h"
 #ifdef OBS_BUILD
@@ -39,7 +39,7 @@ class ANeuralNetworksCompilation;
 
 namespace nnfw {
 
-class NNAPIAllocation : public tflite::MMAPAllocation {
+class NNAPIAllocation : public ::tflite::MMAPAllocation {
  public:
   NNAPIAllocation(const char* filename, ::tflite::ErrorReporter* error_reporter);
   ~NNAPIAllocation();
@@ -90,6 +90,6 @@ class NNAPIDelegate {
 
 } // namespace nnfw
 
-#endif  // TENSORFLOW_CONTRIB_LITE_NNAPI_DELEGATE_H_
+#endif  // __NNFW_TFLITE_EXT_NNAPI_DELEGATE_H__
 
 // clang-format on
index 8bfceb6..b4d0824 100644 (file)
  * @ingroup  COM_AI_RUNTIME
  */
 
-#ifndef __NNFW_SUPPORT_TFLITE_INTERP_BUILDER_H__
-#define __NNFW_SUPPORT_TFLITE_INTERP_BUILDER_H__
+#ifndef __NNFW_TFLITE_INTERP_BUILDER_H__
+#define __NNFW_TFLITE_INTERP_BUILDER_H__
 
 #include <tensorflow/contrib/lite/interpreter.h>
 
 namespace nnfw
 {
-namespace support
-{
 namespace tflite
 {
-namespace interp
-{
 
 /**
  * @brief Structure to Builder
@@ -51,9 +47,7 @@ struct Builder
   virtual std::unique_ptr<::tflite::Interpreter> build(void) const = 0;
 };
 
-} // namespace interp
 } // namespace tflite
-} // namespace support
 } // namespace nnfw
 
-#endif // __NNFW_SUPPORT_TFLITE_INTERP_BUILDER_H__
+#endif // __NNFW_TFLITE_INTERP_BUILDER_H__
index 2758686..13470b8 100644 (file)
@@ -20,8 +20,8 @@
  * @ingroup  COM_AI_RUNTIME
  */
 
-#ifndef __NNFW_SUPPORT_TFLITE_INTERP_FLAT_BUFFER_BUILDER_H__
-#define __NNFW_SUPPORT_TFLITE_INTERP_FLAT_BUFFER_BUILDER_H__
+#ifndef __NNFW_TFLITE_INTERP_FLAT_BUFFER_BUILDER_H__
+#define __NNFW_TFLITE_INTERP_FLAT_BUFFER_BUILDER_H__
 
 #include <tensorflow/contrib/lite/model.h>
 
 
 namespace nnfw
 {
-namespace support
-{
 namespace tflite
 {
-namespace interp
-{
 
 /**
  * @brief Class to define FlatBufferBuilder which is inherited from Builder
@@ -62,9 +58,7 @@ private:
   const ::tflite::FlatBufferModel &_model;
 };
 
-} // namespace interp
 } // namespace tflite
-} // namespace support
 } // namespace nnfw
 
-#endif // __NNFW_SUPPORT_TFLITE_INTERP_FLAT_BUFFER_BUILDER_H__
+#endif // __NNFW_TFLITE_INTERP_FLAT_BUFFER_BUILDER_H__
index bdf765d..0643759 100644 (file)
@@ -20,8 +20,8 @@
  * @ingroup  COM_AI_RUNTIME
  */
 
-#ifndef __NNFW_SUPPORT_TFLITE_INTERP_FUNCTION_BUILDER_H__
-#define __NNFW_SUPPORT_TFLITE_INTERP_FUNCTION_BUILDER_H__
+#ifndef __NNFW_TFLITE_INTERP_FUNCTION_BUILDER_H__
+#define __NNFW_TFLITE_INTERP_FUNCTION_BUILDER_H__
 
 #include <tensorflow/contrib/lite/model.h>
 
 
 namespace nnfw
 {
-namespace support
-{
 namespace tflite
 {
-namespace interp
-{
 
 /**
  * @brief Class to define FunctionBuilder which is inherited from Builder
@@ -65,9 +61,7 @@ private:
   SetupFunc _fn;
 };
 
-} // namespace interp
 } // namespace tflite
-} // namespace support
 } // namespace nnfw
 
-#endif // __NNFW_SUPPORT_TFLITE_INTERP_FUNCTION_BUILDER_H__
+#endif // __NNFW_TFLITE_INTERP_FUNCTION_BUILDER_H__
index f2b4254..3759c66 100644 (file)
@@ -15,7 +15,7 @@
  */
 
 #include "tflite/Diff.h"
-#include "tflite/nnapi_delegate.h"
+#include "tflite/ext/nnapi_delegate.h"
 
 #include "util/fp32.h"
 
@@ -79,9 +79,9 @@ void DiffSummary::notify(const nnfw::util::tensor::Index &index, float expected,
 }
 
 template <typename T>
-bool TfLiteInterpMatchApp::compareSingleTensorView(
-    const nnfw::support::tflite::TensorView<T> &expected,
-    const nnfw::support::tflite::TensorView<T> &obtained, int id) const
+bool TfLiteInterpMatchApp::compareSingleTensorView(const nnfw::tflite::TensorView<T> &expected,
+                                                   const nnfw::tflite::TensorView<T> &obtained,
+                                                   int id) const
 {
   std::vector<nnfw::util::tensor::Diff<T>> diffs;
   assert(expected.shape() == obtained.shape());
@@ -125,8 +125,8 @@ bool TfLiteInterpMatchApp::compareSingleTensorView(
 
 template <>
 bool TfLiteInterpMatchApp::compareSingleTensorView<float>(
-    const nnfw::support::tflite::TensorView<float> &expected,
-    const nnfw::support::tflite::TensorView<float> &obtained, int id) const
+    const nnfw::tflite::TensorView<float> &expected,
+    const nnfw::tflite::TensorView<float> &obtained, int id) const
 {
   DiffSummary summary;
 
@@ -206,32 +206,32 @@ bool TfLiteInterpMatchApp::run(::tflite::Interpreter &interp, ::tflite::Interpre
 
   comparators[kTfLiteUInt8] = [this](int id, ::tflite::Interpreter &interp,
                                      ::tflite::Interpreter &nnapi) {
-    const auto expected = nnfw::support::tflite::TensorView<uint8_t>::make(interp, id);
-    const auto obtained = nnfw::support::tflite::TensorView<uint8_t>::make(nnapi, id);
+    const auto expected = nnfw::tflite::TensorView<uint8_t>::make(interp, id);
+    const auto obtained = nnfw::tflite::TensorView<uint8_t>::make(nnapi, id);
 
     return compareSingleTensorView(expected, obtained, id);
   };
 
   comparators[kTfLiteInt32] = [this](int id, ::tflite::Interpreter &interp,
                                      ::tflite::Interpreter &nnapi) {
-    const auto expected = nnfw::support::tflite::TensorView<int32_t>::make(interp, id);
-    const auto obtained = nnfw::support::tflite::TensorView<int32_t>::make(nnapi, id);
+    const auto expected = nnfw::tflite::TensorView<int32_t>::make(interp, id);
+    const auto obtained = nnfw::tflite::TensorView<int32_t>::make(nnapi, id);
 
     return compareSingleTensorView(expected, obtained, id);
   };
 
   comparators[kTfLiteFloat32] = [this](int id, ::tflite::Interpreter &interp,
                                        ::tflite::Interpreter &nnapi) {
-    const auto expected = nnfw::support::tflite::TensorView<float>::make(interp, id);
-    const auto obtained = nnfw::support::tflite::TensorView<float>::make(nnapi, id);
+    const auto expected = nnfw::tflite::TensorView<float>::make(interp, id);
+    const auto obtained = nnfw::tflite::TensorView<float>::make(nnapi, id);
 
     return compareSingleTensorView(expected, obtained, id);
   };
 
   comparators[kTfLiteBool] = [this](int id, ::tflite::Interpreter &interp,
                                     ::tflite::Interpreter &nnapi) {
-    const auto expected = nnfw::support::tflite::TensorView<bool>::make(interp, id);
-    const auto obtained = nnfw::support::tflite::TensorView<bool>::make(nnapi, id);
+    const auto expected = nnfw::tflite::TensorView<bool>::make(interp, id);
+    const auto obtained = nnfw::tflite::TensorView<bool>::make(nnapi, id);
 
     return compareSingleTensorView(expected, obtained, id);
   };
@@ -277,7 +277,7 @@ template <> uint8_t RandomGenerator::generate<uint8_t>(void)
 //
 // Random Test Runner
 //
-int RandomTestRunner::run(const nnfw::support::tflite::interp::Builder &builder)
+int RandomTestRunner::run(const nnfw::tflite::Builder &builder)
 {
   auto tfl_interp = builder.build();
   auto nnapi = builder.build();
@@ -301,8 +301,8 @@ int RandomTestRunner::run(const nnfw::support::tflite::interp::Builder &builder)
     assert(tfl_interp->tensor(id)->type == kTfLiteInt32);
     assert(nnapi->tensor(id)->type == kTfLiteInt32);
 
-    auto tfl_interp_view = nnfw::support::tflite::TensorView<int32_t>::make(*tfl_interp, id);
-    auto nnapi_view = nnfw::support::tflite::TensorView<int32_t>::make(*nnapi, id);
+    auto tfl_interp_view = nnfw::tflite::TensorView<int32_t>::make(*tfl_interp, id);
+    auto nnapi_view = nnfw::tflite::TensorView<int32_t>::make(*nnapi, id);
 
     assert(tfl_interp_view.shape() == nnapi_view.shape());
 
@@ -322,8 +322,8 @@ int RandomTestRunner::run(const nnfw::support::tflite::interp::Builder &builder)
     assert(tfl_interp->tensor(id)->type == kTfLiteInt32);
     assert(nnapi->tensor(id)->type == kTfLiteInt32);
 
-    auto tfl_interp_view = nnfw::support::tflite::TensorView<int32_t>::make(*tfl_interp, id);
-    auto nnapi_view = nnfw::support::tflite::TensorView<int32_t>::make(*nnapi, id);
+    auto tfl_interp_view = nnfw::tflite::TensorView<int32_t>::make(*tfl_interp, id);
+    auto nnapi_view = nnfw::tflite::TensorView<int32_t>::make(*nnapi, id);
 
     assert(tfl_interp_view.shape() == nnapi_view.shape());
 
@@ -341,8 +341,8 @@ int RandomTestRunner::run(const nnfw::support::tflite::interp::Builder &builder)
     assert(tfl_interp->tensor(id)->type == kTfLiteUInt8);
     assert(nnapi->tensor(id)->type == kTfLiteUInt8);
 
-    auto tfl_interp_view = nnfw::support::tflite::TensorView<uint8_t>::make(*tfl_interp, id);
-    auto nnapi_view = nnfw::support::tflite::TensorView<uint8_t>::make(*nnapi, id);
+    auto tfl_interp_view = nnfw::tflite::TensorView<uint8_t>::make(*tfl_interp, id);
+    auto nnapi_view = nnfw::tflite::TensorView<uint8_t>::make(*nnapi, id);
 
     assert(tfl_interp_view.shape() == nnapi_view.shape());
 
@@ -366,8 +366,8 @@ int RandomTestRunner::run(const nnfw::support::tflite::interp::Builder &builder)
     assert(tfl_interp->tensor(id)->type == kTfLiteUInt8);
     assert(nnapi->tensor(id)->type == kTfLiteUInt8);
 
-    auto tfl_interp_view = nnfw::support::tflite::TensorView<uint8_t>::make(*tfl_interp, id);
-    auto nnapi_view = nnfw::support::tflite::TensorView<uint8_t>::make(*nnapi, id);
+    auto tfl_interp_view = nnfw::tflite::TensorView<uint8_t>::make(*tfl_interp, id);
+    auto nnapi_view = nnfw::tflite::TensorView<uint8_t>::make(*nnapi, id);
 
     assert(tfl_interp_view.shape() == nnapi_view.shape());
 
@@ -391,8 +391,8 @@ int RandomTestRunner::run(const nnfw::support::tflite::interp::Builder &builder)
     assert(tfl_interp->tensor(id)->type == kTfLiteFloat32);
     assert(nnapi->tensor(id)->type == kTfLiteFloat32);
 
-    auto tfl_interp_view = nnfw::support::tflite::TensorView<float>::make(*tfl_interp, id);
-    auto nnapi_view = nnfw::support::tflite::TensorView<float>::make(*nnapi, id);
+    auto tfl_interp_view = nnfw::tflite::TensorView<float>::make(*tfl_interp, id);
+    auto nnapi_view = nnfw::tflite::TensorView<float>::make(*nnapi, id);
 
     assert(tfl_interp_view.shape() == nnapi_view.shape());
 
@@ -417,8 +417,8 @@ int RandomTestRunner::run(const nnfw::support::tflite::interp::Builder &builder)
     assert(tfl_interp->tensor(id)->type == kTfLiteFloat32);
     assert(nnapi->tensor(id)->type == kTfLiteFloat32);
 
-    auto tfl_interp_view = nnfw::support::tflite::TensorView<float>::make(*tfl_interp, id);
-    auto nnapi_view = nnfw::support::tflite::TensorView<float>::make(*nnapi, id);
+    auto tfl_interp_view = nnfw::tflite::TensorView<float>::make(*tfl_interp, id);
+    auto nnapi_view = nnfw::tflite::TensorView<float>::make(*nnapi, id);
 
     assert(tfl_interp_view.shape() == nnapi_view.shape());
 
@@ -443,8 +443,8 @@ int RandomTestRunner::run(const nnfw::support::tflite::interp::Builder &builder)
     assert(tfl_interp->tensor(id)->type == kTfLiteBool);
     assert(nnapi->tensor(id)->type == kTfLiteBool);
 
-    auto tfl_interp_view = nnfw::support::tflite::TensorView<bool>::make(*tfl_interp, id);
-    auto nnapi_view = nnfw::support::tflite::TensorView<bool>::make(*nnapi, id);
+    auto tfl_interp_view = nnfw::tflite::TensorView<bool>::make(*tfl_interp, id);
+    auto nnapi_view = nnfw::tflite::TensorView<bool>::make(*nnapi, id);
 
     assert(tfl_interp_view.shape() == nnapi_view.shape());
 
@@ -469,8 +469,8 @@ int RandomTestRunner::run(const nnfw::support::tflite::interp::Builder &builder)
     assert(tfl_interp->tensor(id)->type == kTfLiteBool);
     assert(nnapi->tensor(id)->type == kTfLiteBool);
 
-    auto tfl_interp_view = nnfw::support::tflite::TensorView<bool>::make(*tfl_interp, id);
-    auto nnapi_view = nnfw::support::tflite::TensorView<bool>::make(*nnapi, id);
+    auto tfl_interp_view = nnfw::tflite::TensorView<bool>::make(*tfl_interp, id);
+    auto nnapi_view = nnfw::tflite::TensorView<bool>::make(*nnapi, id);
 
     assert(tfl_interp_view.shape() == nnapi_view.shape());
 
@@ -579,7 +579,7 @@ int RandomTestRunner::run(const nnfw::support::tflite::interp::Builder &builder)
   std::cout << "[NNAPI TEST] PASSED" << std::endl;
 
   if (_param.tensor_logging)
-    nnfw::support::tflite::TensorLogger::instance().save(_param.log_path, *tfl_interp);
+    nnfw::tflite::TensorLogger::instance().save(_param.log_path, *tfl_interp);
 
   return 0;
 }
index 7b226ed..3b34ce4 100644 (file)
@@ -21,8 +21,6 @@
 
 namespace nnfw
 {
-namespace support
-{
 namespace tflite
 {
 
@@ -69,5 +67,4 @@ float &FeatureView<float>::at(uint32_t ch, uint32_t row, uint32_t col)
 }
 
 } // namespace tflite
-} // namespace support
 } // namespace nnfw
index 3913748..1c8714e 100644 (file)
@@ -2,8 +2,6 @@
 
 namespace nnfw
 {
-namespace support
-{
 namespace tflite
 {
 
@@ -47,5 +45,4 @@ nnfw::util::tensor::Shape broadcast(const nnfw::util::tensor::Shape &lhs_shape,
 }
 
 } // namespace tflite
-} // namespace support
 } // namespace nnfw
index 0c461fe..61bc47e 100644 (file)
@@ -23,7 +23,7 @@ void int_test(void)
   int value[6] = {1, 2, 3, 4, 5, 6};
 
   const nnfw::util::tensor::Shape shape{2, 3};
-  const nnfw::support::tflite::TensorView<int> view{shape, value};
+  const nnfw::tflite::TensorView<int> view{shape, value};
 
   assert(view.at(nnfw::util::tensor::Index{0, 0}) == 1);
   assert(view.at(nnfw::util::tensor::Index{0, 1}) == 2);
@@ -38,7 +38,7 @@ int main(int argc, char **argv)
   float value[6] = {1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f};
 
   const nnfw::util::tensor::Shape shape{2, 3};
-  const nnfw::support::tflite::TensorView<float> view{shape, value};
+  const nnfw::tflite::TensorView<float> view{shape, value};
 
   assert(view.at(nnfw::util::tensor::Index{0, 0}) == 1.0f);
   assert(view.at(nnfw::util::tensor::Index{0, 1}) == 2.0f);
similarity index 98%
rename from libs/tflite/src/kernels/Abs.cpp
rename to libs/tflite/src/ext/kernels/Abs.cpp
index 87f09de..047fead 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "tflite/kernels/Abs.h"
+#include "tflite/ext/kernels/Abs.h"
 #include "tensorflow/contrib/lite/kernels/kernel_util.h"
 
 #include <iostream>
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "tflite/kernels/SquaredDifference.h"
+#include "tflite/ext/kernels/SquaredDifference.h"
 #include "tensorflow/contrib/lite/kernels/kernel_util.h"
 
 #include <iostream>
similarity index 99%
rename from libs/tflite/src/kernels/TensorFlowMax.cpp
rename to libs/tflite/src/ext/kernels/TensorFlowMax.cpp
index 7a85bc8..2817175 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "tflite/kernels/TensorFlowMax.h"
+#include "tflite/ext/kernels/TensorFlowMax.h"
 #include "tensorflow/contrib/lite/kernels/kernel_util.h"
 
 #include <iostream>
similarity index 99%
rename from libs/tflite/src/kernels/TensorFlowSum.cpp
rename to libs/tflite/src/ext/kernels/TensorFlowSum.cpp
index 1eba62f..da614ab 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "tflite/kernels/TensorFlowSum.h"
+#include "tflite/ext/kernels/TensorFlowSum.h"
 #include "tensorflow/contrib/lite/kernels/kernel_util.h"
 
 #include <iostream>
similarity index 99%
rename from libs/tflite/src/kernels/register.cpp
rename to libs/tflite/src/ext/kernels/register.cpp
index 9757e4a..ed4cd2c 100644 (file)
@@ -16,8 +16,8 @@ limitations under the License.
 
 // NOTE This code is derived from the following file (in TensorFlow)
 //        'externals/tensorflow/tensorflow/contrib/lite/kernels/register.cc'
-#include "tflite/kernels/register.h"
-#include "tflite/kernels/CustomOps.h"
+#include "tflite/ext/kernels/register.h"
+#include "tflite/ext/kernels/CustomOps.h"
 
 // TODO Use namespace nnfw
 namespace tflite
similarity index 99%
rename from libs/tflite/src/nnapi_delegate.cpp
rename to libs/tflite/src/ext/nnapi_delegate.cpp
index c196a7a..0cc5a74 100644 (file)
@@ -19,7 +19,7 @@ limitations under the License.
 
 // NOTE This code is derived from the following file (in TensorFlow v1.12)
 //        'externals/tensorflow/tensorflow/contrib/lite/nnapi_delegate.cc'
-#include "tflite/nnapi_delegate.h"
+#include "tflite/ext/nnapi_delegate.h"
 #include <fcntl.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
index 87e022c..84246d3 100644 (file)
 
 #include "tflite/interp/FlatBufferBuilder.h"
 
-#include "tflite/kernels/register.h"
+#include "tflite/ext/kernels/register.h"
 
 namespace nnfw
 {
-namespace support
-{
 namespace tflite
 {
-namespace interp
-{
 
 std::unique_ptr<::tflite::Interpreter> FlatBufferBuilder::build(void) const
 {
@@ -40,7 +36,5 @@ std::unique_ptr<::tflite::Interpreter> FlatBufferBuilder::build(void) const
   return std::move(interpreter);
 }
 
-} // namespace interp
 } // namespace tflite
-} // namespace support
 } // namespace nnfw
index c06d86d..eab940c 100644 (file)
 
 namespace nnfw
 {
-namespace support
-{
 namespace tflite
 {
-namespace interp
-{
 
 std::unique_ptr<::tflite::Interpreter> FunctionBuilder::build(void) const
 {
@@ -34,7 +30,5 @@ std::unique_ptr<::tflite::Interpreter> FunctionBuilder::build(void) const
   return std::move(res);
 }
 
-} // namespace interp
 } // namespace tflite
-} // namespace support
 } // namespace nnfw
index 4a19087..31452b2 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "tflite/kernels/register.h"
+#include "tflite/ext/kernels/register.h"
 #include "tensorflow/contrib/lite/model.h"
 
 #include "tflite/interp/FlatBufferBuilder.h"
@@ -41,7 +41,7 @@ int main(const int argc, char **argv)
 
   auto model = FlatBufferModel::BuildFromFile(filename, &error_reporter);
 
-  const nnfw::support::tflite::interp::FlatBufferBuilder builder(*model);
+  const nnfw::tflite::FlatBufferBuilder builder(*model);
 
   try
   {
index 03e7760..30400a3 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "tflite/kernels/register.h"
+#include "tflite/ext/kernels/register.h"
 #include "tensorflow/contrib/lite/model.h"
 
 #include "tflite/Assert.h"
@@ -126,15 +126,15 @@ int main(const int argc, char **argv)
 
   interpreter->SetNumThreads(thread_count);
 
-  std::shared_ptr<nnfw::support::tflite::Session> sess;
+  std::shared_ptr<nnfw::tflite::Session> sess;
 
   if (use_nnapi)
   {
-    sess = std::make_shared<nnfw::support::tflite::NNAPISession>(interpreter.get());
+    sess = std::make_shared<nnfw::tflite::NNAPISession>(interpreter.get());
   }
   else
   {
-    sess = std::make_shared<nnfw::support::tflite::InterpreterSession>(interpreter.get());
+    sess = std::make_shared<nnfw::tflite::InterpreterSession>(interpreter.get());
   }
 
   //
@@ -152,7 +152,7 @@ int main(const int argc, char **argv)
       if (tensor->type == kTfLiteInt32)
       {
         // Generate singed 32-bit integer (s32) input
-        auto tensor_view = nnfw::support::tflite::TensorView<int32_t>::make(*interpreter, id);
+        auto tensor_view = nnfw::tflite::TensorView<int32_t>::make(*interpreter, id);
 
         int32_t value = 0;
 
@@ -167,7 +167,7 @@ int main(const int argc, char **argv)
       else if (tensor->type == kTfLiteUInt8)
       {
         // Generate unsigned 8-bit integer input
-        auto tensor_view = nnfw::support::tflite::TensorView<uint8_t>::make(*interpreter, id);
+        auto tensor_view = nnfw::tflite::TensorView<uint8_t>::make(*interpreter, id);
 
         uint8_t value = 0;
 
index a02cf53..c31b23c 100644 (file)
@@ -42,7 +42,7 @@ limitations under the License.
 #ifdef TFLITE_FLEX
 #include "tensorflow/contrib/lite/delegates/flex/delegate.h"
 #endif  // TFLITE_FLEX
-#include "tflite/kernels/register.h"
+#include "tflite/ext/kernels/register.h"
 #include "tensorflow/contrib/lite/model.h"
 #include "tensorflow/contrib/lite/op_resolver.h"
 #include "tensorflow/contrib/lite/string_util.h"
@@ -50,7 +50,7 @@ limitations under the License.
 
 // For profiling nnapi_delegate
 #include "util/profiling/profiling.h"
-#include "tflite/nnapi_delegate.h"
+#include "tflite/ext/nnapi_delegate.h"
 
 namespace {
   nnfw::NNAPIDelegate nnfw_delegate_;
index 56f5d3e..43693b9 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "tflite/kernels/register.h"
+#include "tflite/ext/kernels/register.h"
 #include "tensorflow/contrib/lite/model.h"
 #include "tensorflow/contrib/lite/builtin_op_data.h"
 
index 678ff08..6c1ad26 100644 (file)
@@ -48,7 +48,7 @@ void TensorLoader::load(const std::string &filename)
     assert(tensor->bytes % sizeof(float) == 0);
     offset += (tensor->bytes / sizeof(float));
 
-    _tensor_map.insert(std::make_pair(o, nnfw::support::tflite::TensorView<float>(shape, base)));
+    _tensor_map.insert(std::make_pair(o, nnfw::tflite::TensorView<float>(shape, base)));
   }
 
   // The file size and total output tensor size must match
@@ -57,7 +57,7 @@ void TensorLoader::load(const std::string &filename)
   file.close();
 }
 
-const nnfw::support::tflite::TensorView<float> &TensorLoader::get(int tensor_idx) const
+const nnfw::tflite::TensorView<float> &TensorLoader::get(int tensor_idx) const
 {
   auto found = _tensor_map.find(tensor_idx);
   assert(found != _tensor_map.end());
index 2d4fdb7..fc4a37a 100644 (file)
@@ -21,13 +21,13 @@ class TensorLoader
 public:
   TensorLoader(tflite::Interpreter &interpreter);
   void load(const std::string &filename);
-  const nnfw::support::tflite::TensorView<float> &get(int tensor_idx) const;
+  const nnfw::tflite::TensorView<float> &get(int tensor_idx) const;
   size_t getNums() const { return _tensor_map.size(); }
 
 private:
   tflite::Interpreter &_interpreter;
   std::unique_ptr<float> _raw_data;
-  std::unordered_map<int, nnfw::support::tflite::TensorView<float>> _tensor_map;
+  std::unordered_map<int, nnfw::tflite::TensorView<float>> _tensor_map;
 };
 
 } // end of namespace TFLiteRun
index 142ae1e..3fe870b 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "tflite/kernels/register.h"
+#include "tflite/ext/kernels/register.h"
 #include "tensorflow/contrib/lite/model.h"
 
 #include "bin_image.h"
@@ -75,15 +75,15 @@ int main(const int argc, char **argv)
     interpreter->SetNumThreads(1);
   };
 
-  std::shared_ptr<nnfw::support::tflite::Session> sess;
+  std::shared_ptr<nnfw::tflite::Session> sess;
 
   if (use_nnapi)
   {
-    sess = std::make_shared<nnfw::support::tflite::NNAPISession>(interpreter.get());
+    sess = std::make_shared<nnfw::tflite::NNAPISession>(interpreter.get());
   }
   else
   {
-    sess = std::make_shared<nnfw::support::tflite::InterpreterSession>(interpreter.get());
+    sess = std::make_shared<nnfw::tflite::InterpreterSession>(interpreter.get());
   }
 
   sess->prepare();
@@ -127,7 +127,7 @@ int main(const int argc, char **argv)
       if (tensor->type == kTfLiteInt32)
       {
         // Generate singed 32-bit integer (s32) input
-        auto tensor_view = nnfw::support::tflite::TensorView<int32_t>::make(*interpreter, o);
+        auto tensor_view = nnfw::tflite::TensorView<int32_t>::make(*interpreter, o);
 
         int32_t value = 0;
 
@@ -142,7 +142,7 @@ int main(const int argc, char **argv)
       else if (tensor->type == kTfLiteUInt8)
       {
         // Generate unsigned 8-bit integer input
-        auto tensor_view = nnfw::support::tflite::TensorView<uint8_t>::make(*interpreter, o);
+        auto tensor_view = nnfw::tflite::TensorView<uint8_t>::make(*interpreter, o);
 
         uint8_t value = 0;
 
@@ -258,7 +258,7 @@ int main(const int argc, char **argv)
     for (const auto &o : interpreter->outputs())
     {
       auto expected = tensor_loader.get(o);
-      auto obtained = nnfw::support::tflite::TensorView<float>::make(*interpreter, o);
+      auto obtained = nnfw::tflite::TensorView<float>::make(*interpreter, o);
 
       res = res && app.compareSingleTensorView(expected, obtained, o);
     }