[mir_caffe2] Rename namespace nnc to mir_caffe2 in Caffe2 importer (#6238)
authorСергей Баранников/AI Tools Lab /SRR/Engineer/삼성전자 <s.barannikov@samsung.com>
Mon, 5 Aug 2019 16:43:06 +0000 (19:43 +0300)
committerEfimov Alexander/AI Tools Lab/./Samsung Electronics <a.efimov@samsung.com>
Mon, 5 Aug 2019 16:43:06 +0000 (19:43 +0300)
* Rename namespace and include guards in Caffe2 importer
* Fix usages of the namespace in `nnc`

Signed-off-by: Sergei Barannikov <s.barannikov@samsung.com>
compiler/mir-caffe2-importer/caffe2_importer.cpp
compiler/mir-caffe2-importer/caffe2_importer.h
compiler/mir-caffe2-importer/caffe2_op_creator.cpp
compiler/mir-caffe2-importer/caffe2_op_creator.h
compiler/mir-caffe2-importer/caffe2_op_types.h
compiler/mir-caffe2-importer/caffe2_proto_helper.cpp
compiler/mir-caffe2-importer/caffe2_proto_helper.h
compiler/nnc/passes/caffe2_frontend/caffe2_importer_pass.cpp
compiler/nnc/passes/caffe2_frontend/caffe2_importer_pass.h

index 1d09a9e..2d95146 100644 (file)
@@ -34,7 +34,7 @@
 #include <utility>
 #include <vector>
 
-namespace nnc
+namespace mir_caffe2
 {
 
 using namespace ::caffe2;
@@ -257,4 +257,4 @@ const std::map<std::string, SupportedCaffe2OpType> Caffe2Importer::_operatorType
     {"GivenTensorInt64Fill", SupportedCaffe2OpType::givenTensorInt64Fill},
 };
 
-} // namespace nnc
+} // namespace mir_caffe2
index cd7ad6e..782462d 100644 (file)
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef NNCC_CAFFE2_IMPORTER_H
-#define NNCC_CAFFE2_IMPORTER_H
+#ifndef MIR_CAFFE2_IMPORTER_H
+#define MIR_CAFFE2_IMPORTER_H
 
 #include <set>
 #include <string>
@@ -25,7 +25,7 @@
 #include "caffe2_op_creator.h"
 #include "caffe2_op_types.h"
 
-namespace nnc
+namespace mir_caffe2
 {
 
 class Caffe2Importer
@@ -79,6 +79,6 @@ private:
   void setGraphOutputs();
 };
 
-} // namespace nnc
+} // namespace mir_caffe2
 
-#endif // NNCC_CAFFE2_IMPORTER_H
+#endif // MIR_CAFFE2_IMPORTER_H
index 038f746..3851796 100644 (file)
@@ -46,7 +46,7 @@
 #include <cmath>
 #include <vector>
 
-namespace nnc
+namespace mir_caffe2
 {
 
 static mir::TensorVariant fixGroupedKernel(int groups, const mir::TensorVariant &folded_kernel)
@@ -655,4 +655,4 @@ Operation::Output *Caffe2OpCreator::createInput(const std::string &name, const m
   return _graph->create<ops::InputOp>(name, shape)->getOutput(0);
 }
 
-} // namespace nnc
+} // namespace mir_caffe2
index 675e9a0..41cda23 100644 (file)
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef NNCC_CAFFE2_OP_CREATOR_H
-#define NNCC_CAFFE2_OP_CREATOR_H
+#ifndef MIR_CAFFE2_OP_CREATOR_H
+#define MIR_CAFFE2_OP_CREATOR_H
 
 #include <set>
 #include <unordered_map>
@@ -30,7 +30,7 @@
 
 #include "caffe2/proto/caffe2.pb.h"
 
-namespace nnc
+namespace mir_caffe2
 {
 
 using mir::Operation;
@@ -123,6 +123,6 @@ mir::Operation *Caffe2OpCreator::createOp(const std::string &name, Types &&... a
   return new_op;
 }
 
-} // namespace nnc
+} // namespace mir_caffe2
 
-#endif // NNCC_CAFFE2_OP_CREATOR_H
+#endif // MIR_CAFFE2_OP_CREATOR_H
index 035aea1..b5e7e76 100644 (file)
  * limitations under the License.
  */
 
-#ifndef NNCC_CAFFE2_OP_TYPES_H
-#define NNCC_CAFFE2_OP_TYPES_H
+#ifndef MIR_CAFFE2_OP_TYPES_H
+#define MIR_CAFFE2_OP_TYPES_H
 
-namespace nnc
+namespace mir_caffe2
 {
 
 enum class SupportedCaffe2OpType
@@ -43,6 +43,6 @@ enum class SupportedCaffe2OpType
   sum,
 };
 
-} // namespace nnc
+} // namespace mir_caffe2
 
-#endif // NNCC_CAFFE2_OP_TYPES_H
+#endif // MIR_CAFFE2_OP_TYPES_H
index d47a254..a7cde64 100644 (file)
@@ -16,7 +16,7 @@
 
 #include "caffe2_proto_helper.h"
 
-namespace nnc
+namespace mir_caffe2
 {
 
 const ::caffe2::Argument &findArgumentByName(RepArgument args, const std::string &name)
@@ -59,4 +59,4 @@ std::string getSingleArgument(const ::caffe2::OperatorDef &op, const std::string
   return default_value;
 }
 
-} // namespace nnc
+} // namespace mir_caffe2
index 46e3580..4c47ede 100644 (file)
  * limitations under the License.
  */
 
-#ifndef NNCC_CAFFE2_PROTO_HELPER_H
-#define NNCC_CAFFE2_PROTO_HELPER_H
+#ifndef MIR_CAFFE2_PROTO_HELPER_H
+#define MIR_CAFFE2_PROTO_HELPER_H
 
 #include "caffe2/proto/caffe2.pb.h"
 
-namespace nnc
+namespace mir_caffe2
 {
 
 using RepArgument = const ::google::protobuf::RepeatedPtrField<::caffe2::Argument> &;
@@ -35,6 +35,6 @@ float getSingleArgument(const ::caffe2::OperatorDef &op, const std::string &argu
 std::string getSingleArgument(const ::caffe2::OperatorDef &op, const std::string &argument_name,
                               const std::string &default_value);
 
-} // namespace nnc
+} // namespace mir_caffe2
 
-#endif // NNCC_CAFFE2_PROTO_HELPER_H
+#endif // MIR_CAFFE2_PROTO_HELPER_H
index 03701d2..4230fbe 100644 (file)
@@ -22,7 +22,7 @@ namespace nnc
 
 Caffe2ImporterPass::Caffe2ImporterPass(const std::string &predict_net, const std::string &init_net,
                                        const std::vector<std::vector<int>> &input_shapes)
-    : _pimpl(new Caffe2Importer(predict_net, init_net, input_shapes))
+    : _pimpl(new mir_caffe2::Caffe2Importer(predict_net, init_net, input_shapes))
 {
 }
 
index ec59bcf..776d2d6 100644 (file)
 #include <memory>
 #include <string>
 
+namespace mir_caffe2
+{
+class Caffe2Importer;
+} // namespace mir_caffe2
+
 namespace nnc
 {
 
-class Caffe2Importer;
 class Caffe2ImporterPass : public NNImporter
 {
 public:
@@ -39,7 +43,7 @@ public:
   ~Caffe2ImporterPass() override;
 
 private:
-  std::unique_ptr<Caffe2Importer> _pimpl;
+  std::unique_ptr<mir_caffe2::Caffe2Importer> _pimpl;
   std::unique_ptr<mir::Graph> _graph;
 };