From: Сергей Баранников/AI Tools Lab /SRR/Engineer/삼성전자 Date: Mon, 5 Aug 2019 16:45:25 +0000 (+0300) Subject: [mir_tflite] Rename namespace nnc to mir_tflite in TFLite importer (#6240) X-Git-Tag: submit/tizen/20190809.050447~150 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d2abecfa2a7a74bac83fe72224045bb76cb8cee9;p=platform%2Fcore%2Fml%2Fnnfw.git [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 --- 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; };