diff --git a/mindspore/nn/layer/conv.py b/mindspore/nn/layer/conv.py index 96bcd966ef..c57149aea8 100644 --- a/mindspore/nn/layer/conv.py +++ b/mindspore/nn/layer/conv.py @@ -70,7 +70,8 @@ class _Conv(Cell): kernel_size[0] < 1 or kernel_size[1] < 1: raise ValueError("Attr 'kernel_size' of 'Conv2D' Op passed " + str(self.kernel_size) + ", should be a int or tuple and equal to or greater than 1.") - if (not isinstance(stride[0], int)) or (not isinstance(stride[1], int)) or stride[0] < 1 or stride[1] < 1: + if (not isinstance(stride[0], int)) or (not isinstance(stride[1], int)) or \ + isinstance(stride[0], bool) or isinstance(stride[1], bool) or stride[0] < 1 or stride[1] < 1: raise ValueError("Attr 'stride' of 'Conv2D' Op passed " + str(self.stride) + ", should be a int or tuple and equal to or greater than 1.") if (not isinstance(dilation[0], int)) or (not isinstance(dilation[1], int)) or \ diff --git a/mindspore/ops/operations/math_ops.py b/mindspore/ops/operations/math_ops.py index ae16a4e92c..fec60a5b00 100644 --- a/mindspore/ops/operations/math_ops.py +++ b/mindspore/ops/operations/math_ops.py @@ -786,7 +786,7 @@ class AddN(PrimitiveWithInfer): >>> input_x = Tensor(np.array([1, 2, 3]), mindspore.float32) >>> input_y = Tensor(np.array([4, 5, 6]), mindspore.float32) >>> net(input_x, input_y, input_x, input_y) - Tensor([10, 14, 18], shape=(3,), dtype=mindspore.int32) + [10.0, 14.0, 18.0] """ @prim_attr_register @@ -2064,9 +2064,9 @@ class Xlogy(_MathBinaryOp): Examples: >>> input_x = Tensor(np.array([-5, 0, 4]), mindspore.float32) - >>> input_y = Tensor(np.array([2, 2, 2]), mindspore.float32) + >>> input_y = Tensor(np.array([2, 2, 2]), mindspore.float32) >>> xlogy = P.Xlogy() - >>> Xlogy(input_x, input_y) + >>> xlogy(input_x, input_y) [-3.465736, 0.0, 2.7725887] """