diff --git a/mindspore/_checkparam.py b/mindspore/_checkparam.py index 40a402bb49..e1edc32ce3 100644 --- a/mindspore/_checkparam.py +++ b/mindspore/_checkparam.py @@ -139,7 +139,7 @@ class Validator: def check_int_range(arg_name, arg_value, lower_limit, upper_limit, rel, prim_name): """Method for checking whether an int value is in some range.""" rel_fn = Rel.get_fns(rel) - type_mismatch = not isinstance(arg_value, int) + type_mismatch = not isinstance(arg_value, int) or isinstance(arg_value, bool) excp_cls = TypeError if type_mismatch else ValueError if type_mismatch or not rel_fn(arg_value, lower_limit, upper_limit): rel_str = Rel.get_strs(rel).format(lower_limit, upper_limit) diff --git a/mindspore/nn/layer/conv.py b/mindspore/nn/layer/conv.py index 13f3ee4c23..b0bcba8522 100644 --- a/mindspore/nn/layer/conv.py +++ b/mindspore/nn/layer/conv.py @@ -461,7 +461,8 @@ class Conv2dTranspose(_Conv): width of the kernel. stride (Union[int, tuple[int]]): The distance of kernel moving, an int number that represents the height and width of movement are both strides, or a tuple of two int numbers that - represent height and width of movement respectively. Default: 1. + represent height and width of movement respectively. Its value should be equal to or greater than 1. + Default: 1. pad_mode (str): Select the mode of the pad. The optional values are "pad", "same", "valid". Default: "same". diff --git a/mindspore/ops/operations/array_ops.py b/mindspore/ops/operations/array_ops.py index 0a9116b63e..bfc2f31627 100644 --- a/mindspore/ops/operations/array_ops.py +++ b/mindspore/ops/operations/array_ops.py @@ -115,6 +115,8 @@ class ExpandDims(PrimitiveWithInfer): >>> input_tensor = Tensor(np.array([[2, 2], [2, 2]]), mindspore.float32) >>> expand_dims = P.ExpandDims() >>> output = expand_dims(input_tensor, 0) + [[[2.0, 2.0], + [2.0, 2.0]]] """ @prim_attr_register @@ -887,6 +889,8 @@ class Fill(PrimitiveWithInfer): Examples: >>> fill = P.Fill() >>> fill(mindspore.float32, (2, 2), 1) + [[1.0, 1.0], + [1.0, 1.0]] """ @prim_attr_register @@ -2364,6 +2368,8 @@ class Eye(PrimitiveWithInfer): Examples: >>> eye = P.Eye() >>> out_tensor = eye(2, 2, mindspore.int32) + [[1, 0], + [0, 1]] """ @prim_attr_register diff --git a/mindspore/ops/operations/math_ops.py b/mindspore/ops/operations/math_ops.py index b4fd9bf28a..8355e4aa29 100644 --- a/mindspore/ops/operations/math_ops.py +++ b/mindspore/ops/operations/math_ops.py @@ -2244,10 +2244,10 @@ class Equal(_LogicBinaryOp): When the inputs are one tensor and one scalar, the scalar only could be a constant. Inputs: - - **input_x** (Union[Tensor, Number, bool]) - The first input is a number or - a bool or a tensor whose data type is number or bool. - - **input_y** (Union[Tensor, Number, bool]) - The second input is a number or - a bool when the first input is a tensor or a tensor whose data type is number or bool. + - **input_x** (Union[Tensor, Number]) - The first input is a number or + a tensor whose data type is number. + - **input_y** (Union[Tensor, Number]) - The second input is a number + when the first input is a tensor or a tensor whose data type is number. Outputs: Tensor, the shape is the same as the one after broadcasting,and the data type is bool.