From ff2941477457168a1e09b1d5b4dbef459a91830a Mon Sep 17 00:00:00 2001 From: dinglinhe Date: Tue, 6 Apr 2021 14:51:30 +0800 Subject: [PATCH] update document of Select --- mindspore/ops/operations/array_ops.py | 9 ++++----- mindspore/ops/operations/math_ops.py | 12 ++++++------ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/mindspore/ops/operations/array_ops.py b/mindspore/ops/operations/array_ops.py index 82f874835c..0ad7cf83f6 100644 --- a/mindspore/ops/operations/array_ops.py +++ b/mindspore/ops/operations/array_ops.py @@ -2752,15 +2752,14 @@ class Select(PrimitiveWithInfer): Returns the selected elements, either from input :math:`x` or input :math:`y`, depending on the `condition`. Given a tensor as input, this operation inserts a dimension of 1 at the dimension, - if both :math:`x` and :math:`y` are none, the operation returns the coordinates of the true - element in the `condition`, the coordinates are returned as a two-dimensional - tensor, where the first dimension (row) represents the number of true elements - and the second dimension (columns) represents the coordinates of the true + it was invalid when both math: 'x' and math: 'y' are none, + the coordinates are returned as a two-dimensional tensor, where the first dimension (row) represents + the number of true elements and the second dimension (columns) represents the coordinates of the true elements. Keep in mind that the shape of the output tensor can vary depending on how many true values are in the input. Indexes are output in row-first order. - If neither is None, :math:`x` and :math:`y` must have the same shape. If :math:`x` and :math:`y` are + math:`x` and :math:`y` must have the same shape. If :math:`x` and :math:`y` are scalars, the conditional tensor must be a scalar. If :math:`x` and :math:`y` are higher-dimensional vectors, the `condition` must be a vector whose size matches the first dimension of :math:`x`, or must have the same shape as :math:`y`. diff --git a/mindspore/ops/operations/math_ops.py b/mindspore/ops/operations/math_ops.py index 206f9c967c..4a4f2e1600 100644 --- a/mindspore/ops/operations/math_ops.py +++ b/mindspore/ops/operations/math_ops.py @@ -2246,21 +2246,21 @@ class MulNoNan(_MathBinaryOp): When the inputs are one tensor and one scalar, the scalar could only be a constant. Note: - The shapes of X and y should be same or can be broadcasting. + The shapes of x and y should be same or can be broadcasted. Inputs: - - **input_x** (Union[Tensor]) - The first input is a tensor whose data type is number. - - **input_y** (Union[Tensor]) - The second input is a tensor whose data type is number. + - **input_x** (Union[Tensor]) - The first input is a tensor whose data type is number or scalar. + - **input_y** (Union[Tensor]) - The second input is a tensor whose data type is number or scalar. Outputs: - Tensor, the shape is the same as the one after broadcasting, - and the data type is the one with higher precision or higher digits among the two inputs. + Tensor, the shape is same to the shape after broadcasting, + the data type is the number with higher precision or higher digits in the two inputs. Supported Platforms: ``Ascend`` Raise: - TypeError: If x or y is a bool tensor. + TypeError: If neither `input_x` nor `input_y` is a bool tensor. Examples: >>> x = Tensor(np.array([[-1.0, 6.0, np.inf], [np.nan, -7.0, 4.0]]), ms.float32)