From 69c9b7e3d1dabc52a20babea59c842baec2fd445 Mon Sep 17 00:00:00 2001 From: liuyang_655 Date: Fri, 22 Jan 2021 16:22:21 +0800 Subject: [PATCH] Modify Conv2D's attr offset_a --- .../ccsrc/backend/optimizer/ascend/mindir/conv2d_unify_mindir.cc | 1 - mindspore/core/ops/conv2d.cc | 1 - mindspore/ops/operations/nn_ops.py | 1 - 3 files changed, 3 deletions(-) diff --git a/mindspore/ccsrc/backend/optimizer/ascend/mindir/conv2d_unify_mindir.cc b/mindspore/ccsrc/backend/optimizer/ascend/mindir/conv2d_unify_mindir.cc index b144fa79f6..b02512154d 100644 --- a/mindspore/ccsrc/backend/optimizer/ascend/mindir/conv2d_unify_mindir.cc +++ b/mindspore/ccsrc/backend/optimizer/ascend/mindir/conv2d_unify_mindir.cc @@ -221,7 +221,6 @@ void SetConv2DAttrs(const CNodePtr &conv2d, const CNodePtr &depth_conv) { SetCommonAttrs(conv2d, depth_conv); AnfAlgo::CopyNodeAttr(kAttrInputNames, conv2d, depth_conv); AnfAlgo::CopyNodeAttr(kAttrStride, conv2d, depth_conv); - AnfAlgo::CopyNodeAttr(kAttrOffsetA, conv2d, depth_conv); } void SetConv2DBackpropInputAttrs(const CNodePtr &conv2d_backin, const CNodePtr &depth_conv_backin) { diff --git a/mindspore/core/ops/conv2d.cc b/mindspore/core/ops/conv2d.cc index 9974b3c1c6..98bf0ed2c4 100644 --- a/mindspore/core/ops/conv2d.cc +++ b/mindspore/core/ops/conv2d.cc @@ -121,7 +121,6 @@ TypePtr Conv2dInferType(const PrimitivePtr &prim, const std::vector &kernel_size, int64_t mode, const PadMode &pad_mode, const std::vector &pad, const std::vector &stride, const std::vector &dilation, int64_t group, const Format &format) { - AddAttr(kOffsetA, MakeValue(static_cast(0))); set_kernel_size(kernel_size); set_stride(stride); set_dilation(dilation); diff --git a/mindspore/ops/operations/nn_ops.py b/mindspore/ops/operations/nn_ops.py index 2fb8638787..0fbb236c1c 100644 --- a/mindspore/ops/operations/nn_ops.py +++ b/mindspore/ops/operations/nn_ops.py @@ -1200,7 +1200,6 @@ class Conv2D(PrimitiveWithInfer): self.out_channel = validator.check_positive_int(out_channel, 'out_channel', self.name) self.group = validator.check_positive_int(group, 'group', self.name) self.add_prim_attr('groups', self.group) - self.add_prim_attr('offset_a', 0) def infer_shape(self, x_shape, w_shape, b_shape=None): x_shape_norm = x_shape if self.format == "NCHW" else (x_shape[0], x_shape[3], x_shape[1], x_shape[2])