From d2abecfa2a7a74bac83fe72224045bb76cb8cee9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9=20=D0=91=D0=B0=D1=80?= =?utf8?q?=D0=B0=D0=BD=D0=BD=D0=B8=D0=BA=D0=BE=D0=B2/AI=20Tools=20Lab=20/S?= =?utf8?q?RR/Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Mon, 5 Aug 2019 19:45:25 +0300 Subject: [PATCH] [mir_tflite] Rename namespace nnc to mir_tflite in TFLite importer (#6240) * Rename namespace and include guards in TFLite importer * Fix usages of the namespace in `nnc` Signed-off-by: Sergei Barannikov --- compiler/mir-tflite-importer/tflite_importer.cpp | 4 ++-- compiler/mir-tflite-importer/tflite_importer.h | 10 +++++----- compiler/mir-tflite-importer/tflite_op_creator.cpp | 4 ++-- compiler/mir-tflite-importer/tflite_op_creator.h | 10 +++++----- compiler/nnc/passes/tflite_frontend/tflite_importer_pass.cpp | 2 +- compiler/nnc/passes/tflite_frontend/tflite_importer_pass.h | 8 ++++++-- 6 files changed, 21 insertions(+), 17 deletions(-) diff --git a/compiler/mir-tflite-importer/tflite_importer.cpp b/compiler/mir-tflite-importer/tflite_importer.cpp index d770909..83adf47 100644 --- a/compiler/mir-tflite-importer/tflite_importer.cpp +++ b/compiler/mir-tflite-importer/tflite_importer.cpp @@ -26,7 +26,7 @@ using namespace ::tflite; -namespace nnc +namespace mir_tflite { TfliteImporter::TfliteImporter(std::string filename) : _filename(std::move(filename)) @@ -399,4 +399,4 @@ void TfliteImporter::setIrNodeNames() } } -} // namespace nnc +} // namespace mir_tflite diff --git a/compiler/mir-tflite-importer/tflite_importer.h b/compiler/mir-tflite-importer/tflite_importer.h index 15966a1..6b866c3 100644 --- a/compiler/mir-tflite-importer/tflite_importer.h +++ b/compiler/mir-tflite-importer/tflite_importer.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef NNCC_TFLITE_IMPORTER_H -#define NNCC_TFLITE_IMPORTER_H +#ifndef MIR_TFLITE_IMPORTER_H +#define MIR_TFLITE_IMPORTER_H #include "schema_generated.h" #include "mir/Graph.h" @@ -26,7 +26,7 @@ #include #include -namespace nnc +namespace mir_tflite { class TFLiteOpCreator; @@ -102,6 +102,6 @@ private: mir::TensorVariant createTensor(const ::tflite::Tensor *t, const ::tflite::Buffer *b); }; -} // namespace nnc +} // namespace mir_tflite -#endif // NNCC_TFLITE_IMPORTER_H +#endif // MIR_TFLITE_IMPORTER_H diff --git a/compiler/mir-tflite-importer/tflite_op_creator.cpp b/compiler/mir-tflite-importer/tflite_op_creator.cpp index 7d03830..1738128 100644 --- a/compiler/mir-tflite-importer/tflite_op_creator.cpp +++ b/compiler/mir-tflite-importer/tflite_op_creator.cpp @@ -48,7 +48,7 @@ using namespace ::tflite; -namespace nnc +namespace mir_tflite { static void calculatePadding(tflite::Padding padding, const Shape &input_shape, @@ -696,4 +696,4 @@ TFLiteOpCreator::convertShape(const ::tflite::ShapeOptions * /*opts*/, return {result->getOutput(0)}; } -} // namespace nnc +} // namespace mir_tflite diff --git a/compiler/mir-tflite-importer/tflite_op_creator.h b/compiler/mir-tflite-importer/tflite_op_creator.h index ddfab8d..0632b68 100644 --- a/compiler/mir-tflite-importer/tflite_op_creator.h +++ b/compiler/mir-tflite-importer/tflite_op_creator.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef NNCC_TFLITE_OP_CREATOR_H -#define NNCC_TFLITE_OP_CREATOR_H +#ifndef MIR_TFLITE_OP_CREATOR_H +#define MIR_TFLITE_OP_CREATOR_H #include "schema_generated.h" @@ -33,7 +33,7 @@ #include #include -namespace nnc +namespace mir_tflite { namespace ops = mir::ops; @@ -193,6 +193,6 @@ mir::Operation *TFLiteOpCreator::createOp(Types &&... args) return _graph->create("", std::forward(args)...); } -} // namespace nnc +} // namespace mir_tflite -#endif // NNCC_TFLITE_OP_CREATOR_H +#endif // MIR_TFLITE_OP_CREATOR_H diff --git a/compiler/nnc/passes/tflite_frontend/tflite_importer_pass.cpp b/compiler/nnc/passes/tflite_frontend/tflite_importer_pass.cpp index babefdd..fd3cb57 100644 --- a/compiler/nnc/passes/tflite_frontend/tflite_importer_pass.cpp +++ b/compiler/nnc/passes/tflite_frontend/tflite_importer_pass.cpp @@ -22,7 +22,7 @@ namespace nnc { TfliteImporterPass::TfliteImporterPass(const std::string &filename) - : _pimpl(new TfliteImporter(filename)) + : _pimpl(new mir_tflite::TfliteImporter(filename)) { } diff --git a/compiler/nnc/passes/tflite_frontend/tflite_importer_pass.h b/compiler/nnc/passes/tflite_frontend/tflite_importer_pass.h index 8c69848..d9fbdd6 100644 --- a/compiler/nnc/passes/tflite_frontend/tflite_importer_pass.h +++ b/compiler/nnc/passes/tflite_frontend/tflite_importer_pass.h @@ -22,10 +22,14 @@ #include #include +namespace mir_tflite +{ +class TfliteImporter; +} // namespace mir_tflite + namespace nnc { -class TfliteImporter; class TfliteImporterPass : public NNImporter { public: @@ -38,7 +42,7 @@ public: ~TfliteImporterPass() override; private: - std::unique_ptr _pimpl; + std::unique_ptr _pimpl; std::unique_ptr _graph; }; -- 2.7.4