[mir] Remove default value of `data_format` parameter (#7420)
authorСергей Баранников/AI Tools Lab /SRR/Engineer/삼성전자 <s.barannikov@samsung.com>
Thu, 12 Sep 2019 17:00:29 +0000 (20:00 +0300)
committerAlexander Efimov/AI Tools Lab/./Samsung Electronics <a.efimov@samsung.com>
Thu, 12 Sep 2019 17:00:29 +0000 (20:00 +0300)
* Remove default value of `data_format` parameter of conv-like op constructors.
* Rename `CommonProps.h` -> `PaddingType.h`.
* Remove deprecated enum members of `PaddingType`.

Signed-off-by: Sergei Barannikov <s.barannikov@samsung.com>
compiler/mir/include/mir/ops/Conv2DOp.h
compiler/mir/include/mir/ops/Deconv2DOp.h
compiler/mir/include/mir/ops/DepthwiseConv2DOp.h
compiler/mir/include/mir/ops/PaddingType.h [moved from compiler/mir/include/mir/ops/CommonProps.h with 91% similarity]
compiler/mir/include/mir/ops/SqrtOp.h

index f2de1f0..602905b 100644 (file)
@@ -31,8 +31,7 @@ class Conv2DOp : public Operation
 public:
   Conv2DOp(Output *input, Output *kernel, const std::vector<std::int32_t> &strides,
            const std::vector<std::int32_t> &padding_before,
-           const std::vector<std::int32_t> &padding_after,
-           DataFormat data_format = DataFormat::NHWC)
+           const std::vector<std::int32_t> &padding_after, DataFormat data_format)
       : Operation(Type::conv2D, {input, kernel}), _strides(strides),
         _padding_before(padding_before), _padding_after(padding_after), _data_format(data_format)
   {
index 6a58b02..68b1797 100644 (file)
@@ -19,7 +19,9 @@
 
 #include "mir/Operation.h"
 #include "mir/DataFormat.h"
-#include "mir/ops/CommonProps.h"
+#include "mir/ops/PaddingType.h"
+
+#include <cstdint>
 #include <vector>
 
 namespace mir
@@ -41,8 +43,7 @@ public:
   }
 
   DeConv2DOp(Output *input, Output *kernel, const std::vector<std::int32_t> &strides,
-             PaddingType padding_type, const Shape &output_shape,
-             DataFormat data_format = DataFormat::NHWC)
+             PaddingType padding_type, const Shape &output_shape, DataFormat data_format)
       : Operation(Type::deConv2D, {input, kernel}), _strides(strides), _padding_type(padding_type),
         _padding_before(2), _padding_after(2), _data_format(data_format)
   {
index 3227e2a..3d31f69 100644 (file)
@@ -31,8 +31,7 @@ class DepthwiseConv2DOp : public Operation
 public:
   DepthwiseConv2DOp(Output *input, Output *kernel, const std::vector<std::int32_t> &strides,
                     const std::vector<std::int32_t> &padding_before,
-                    const std::vector<std::int32_t> &padding_after,
-                    DataFormat data_format = DataFormat::NHWC)
+                    const std::vector<std::int32_t> &padding_after, DataFormat data_format)
       : Operation(Type::depthwiseConv, {input, kernel}), _strides(strides),
         _padding_before(padding_before), _padding_after(padding_after), _data_format(data_format)
   {
similarity index 91%
rename from compiler/mir/include/mir/ops/CommonProps.h
rename to compiler/mir/include/mir/ops/PaddingType.h
index 2b0b4e1..836c8dc 100644 (file)
@@ -28,10 +28,7 @@ enum class PaddingType
   Explicit,
   Valid,
   SameLower,
-  SameUpper,
-  // TODO Remove as deprecated.
-  Same = SameUpper,
-  Custom = Explicit
+  SameUpper
 };
 
 } // namespace ops
index c3800d2..33bde55 100644 (file)
@@ -18,7 +18,6 @@
 #define _MIR_OPS_SQRT_OP_H_
 
 #include "mir/Operation.h"
-#include "mir/ops/CommonProps.h"
 
 namespace mir
 {