From c9923f9a04fc4b168e51bbd88c58e9da2897e03f 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: Thu, 12 Sep 2019 20:00:29 +0300 Subject: [PATCH] [mir] Remove default value of `data_format` parameter (#7420) * 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 --- compiler/mir/include/mir/ops/Conv2DOp.h | 3 +-- compiler/mir/include/mir/ops/Deconv2DOp.h | 7 ++++--- compiler/mir/include/mir/ops/DepthwiseConv2DOp.h | 3 +-- compiler/mir/include/mir/ops/{CommonProps.h => PaddingType.h} | 5 +---- compiler/mir/include/mir/ops/SqrtOp.h | 1 - 5 files changed, 7 insertions(+), 12 deletions(-) rename compiler/mir/include/mir/ops/{CommonProps.h => PaddingType.h} (91%) diff --git a/compiler/mir/include/mir/ops/Conv2DOp.h b/compiler/mir/include/mir/ops/Conv2DOp.h index f2de1f0..602905b 100644 --- a/compiler/mir/include/mir/ops/Conv2DOp.h +++ b/compiler/mir/include/mir/ops/Conv2DOp.h @@ -31,8 +31,7 @@ class Conv2DOp : public Operation public: Conv2DOp(Output *input, Output *kernel, const std::vector &strides, const std::vector &padding_before, - const std::vector &padding_after, - DataFormat data_format = DataFormat::NHWC) + const std::vector &padding_after, DataFormat data_format) : Operation(Type::conv2D, {input, kernel}), _strides(strides), _padding_before(padding_before), _padding_after(padding_after), _data_format(data_format) { diff --git a/compiler/mir/include/mir/ops/Deconv2DOp.h b/compiler/mir/include/mir/ops/Deconv2DOp.h index 6a58b02..68b1797 100644 --- a/compiler/mir/include/mir/ops/Deconv2DOp.h +++ b/compiler/mir/include/mir/ops/Deconv2DOp.h @@ -19,7 +19,9 @@ #include "mir/Operation.h" #include "mir/DataFormat.h" -#include "mir/ops/CommonProps.h" +#include "mir/ops/PaddingType.h" + +#include #include namespace mir @@ -41,8 +43,7 @@ public: } DeConv2DOp(Output *input, Output *kernel, const std::vector &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) { diff --git a/compiler/mir/include/mir/ops/DepthwiseConv2DOp.h b/compiler/mir/include/mir/ops/DepthwiseConv2DOp.h index 3227e2a..3d31f69 100644 --- a/compiler/mir/include/mir/ops/DepthwiseConv2DOp.h +++ b/compiler/mir/include/mir/ops/DepthwiseConv2DOp.h @@ -31,8 +31,7 @@ class DepthwiseConv2DOp : public Operation public: DepthwiseConv2DOp(Output *input, Output *kernel, const std::vector &strides, const std::vector &padding_before, - const std::vector &padding_after, - DataFormat data_format = DataFormat::NHWC) + const std::vector &padding_after, DataFormat data_format) : Operation(Type::depthwiseConv, {input, kernel}), _strides(strides), _padding_before(padding_before), _padding_after(padding_after), _data_format(data_format) { diff --git a/compiler/mir/include/mir/ops/CommonProps.h b/compiler/mir/include/mir/ops/PaddingType.h 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 --- a/compiler/mir/include/mir/ops/CommonProps.h +++ b/compiler/mir/include/mir/ops/PaddingType.h @@ -28,10 +28,7 @@ enum class PaddingType Explicit, Valid, SameLower, - SameUpper, - // TODO Remove as deprecated. - Same = SameUpper, - Custom = Explicit + SameUpper }; } // namespace ops diff --git a/compiler/mir/include/mir/ops/SqrtOp.h b/compiler/mir/include/mir/ops/SqrtOp.h index c3800d2..33bde55 100644 --- a/compiler/mir/include/mir/ops/SqrtOp.h +++ b/compiler/mir/include/mir/ops/SqrtOp.h @@ -18,7 +18,6 @@ #define _MIR_OPS_SQRT_OP_H_ #include "mir/Operation.h" -#include "mir/ops/CommonProps.h" namespace mir { -- 2.7.4