diff --git a/mindspore/ops/operations/__init__.py b/mindspore/ops/operations/__init__.py index af9e84685a2cb0d7c4dff11a4488e0d4c1782818..5151c0b36214864cb575b0eacab73fe8b926178d 100644 --- a/mindspore/ops/operations/__init__.py +++ b/mindspore/ops/operations/__init__.py @@ -142,6 +142,7 @@ __all__ = [ 'ReLUV2', 'Elu', 'Erf', + 'Erfc', 'Sigmoid', 'HSwish', 'HSigmoid', diff --git a/mindspore/ops/operations/control_ops.py b/mindspore/ops/operations/control_ops.py index 2a31b0c98bc0bc665d797e5d8882dc51bf63a71e..2c804c483f97892c90e546884e222eac63d53593 100644 --- a/mindspore/ops/operations/control_ops.py +++ b/mindspore/ops/operations/control_ops.py @@ -84,7 +84,7 @@ class GeSwitch(PrimitiveWithInfer): the true branch will be activated, or vise verse. Inputs: - - **data** (Tensor) - The data to be used for switch control. + - **data** (Union[Tensor, Number]) - The data to be used for switch control. - **pred** (Tensor) - It should be a scalar whose type is bool and shape is `()`, It is used as condition for switch control. Outputs: @@ -144,7 +144,7 @@ class Merge(PrimitiveWithInfer): One and only one of the inputs should be selected as the output Inputs: - - **inputs** (Tuple) - The data to be merged. + - **inputs** (Tuple) - The data to be merged. All tuple elements should have same data type. Outputs: tuple. Output is tuple(`data`, `output_index`). The `data` has the same shape of `inputs` element. @@ -171,6 +171,5 @@ class Merge(PrimitiveWithInfer): for i, item in enumerate(inputs): args['inputs[%d]' % i] = item - validator.check_tensor_type_same( - args, (mstype.bool_,) + mstype.number_type, self.name) + validator.check_scalar_or_tensor_type_same(args, (mstype.bool_,) + mstype.number_type, self.name) return (inputs[0], mstype.int32) diff --git a/mindspore/ops/operations/math_ops.py b/mindspore/ops/operations/math_ops.py index 57fcc2a606db7f531cf2e5a204e093db036e273a..ab64a21498e47a616abb3dac8693fc677c67ce28 100644 --- a/mindspore/ops/operations/math_ops.py +++ b/mindspore/ops/operations/math_ops.py @@ -1397,14 +1397,14 @@ class EqualCount(PrimitiveWithInfer): """ Computes the number of the same elements of two tensors. - The two input tensors should have same shape. + The two input tensors should have same shape and same data type. Inputs: - **input_x** (Tensor) - The first input tensor. - **input_y** (Tensor) - The second input tensor. Outputs: - Tensor, with the type as `mindspore.int32` and size as (1,). + Tensor, with the type same as input tensor and size as (1,). Examples: >>> input_x = Tensor(np.array([1, 2, 3]), mindspore.int32)