!42033 modify format

Merge pull request !42033 from 俞涵/code_docs_0819
This commit is contained in:
i-robot 2022-09-15 10:52:19 +00:00 committed by Gitee
commit a2b328a278
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
7 changed files with 11 additions and 31 deletions

View File

@ -1,7 +1,7 @@
mindspore.ops.relu
==================
.. py:class:: mindspore.ops.relu(input_x)
.. py:function:: mindspore.ops.relu(input_x)
线性修正单元激活函数Rectified Linear Unit

View File

@ -1,7 +1,7 @@
mindspore.ops.relu6
====================
.. py:class:: mindspore.ops.relu6(input_x)
.. py:function:: mindspore.ops.relu6(input_x)
计算输入Tensor的ReLU修正线性单元其上限为6。

View File

@ -1,12 +1,12 @@
mindspore.ops.std
==================
.. py:function:: mindspore.ops.std(x, axis=(), unbiased=True, keep_dims=False)
.. py:function:: mindspore.ops.std(input_x, axis=(), unbiased=True, keep_dims=False)
默认情况下输出Tensor各维度上的标准差与均值也可以对指定维度求标准差与均值。如果 `axis` 是维度列表,则减少对应的维度。
参数:
- **x** (Tensor[Number]) - 输入Tensor其数据类型为数值型。shape :math:`(N, *)` ,其中 :math:`*` 表示任意数量的附加维度。秩应小于8。
- **input_x** (Tensor[Number]) - 输入Tensor其数据类型为数值型。shape :math:`(N, *)` ,其中 :math:`*` 表示任意数量的附加维度。秩应小于8。
- **axis** (Union[int, tuple(int), list(int)]) - 要减少的维度。默认值: (),缩小所有维度。只允许常量值。假设 `x` 的秩为r取值范围[-r,r)。
- **unbiased** (bool) - 如果为True使用贝塞尔校正。否则不使用贝塞尔校正。默认值True。
- **keep_dims** (bool) - 如果为True则保留缩小的维度大小为1。否则移除维度。默认值False。
@ -19,7 +19,7 @@ mindspore.ops.std
- 如果 `axis` 为tuple(int)或list(int),取值为(1, 2),并且 `keep_dims` 为False则输出Tensor的shape为 :math:`(x_0, x_3, ..., x_R)`
异常:
- **TypeError** - `x` 不是Tensor。
- **TypeError** - `input_x` 不是Tensor。
- **TypeError** - `axis` 不是以下数据类型之一int、Tuple或List。
- **TypeError** - `keep_dims` 不是bool类型。
- **ValueError** - `axis` 超出范围。

View File

@ -5535,7 +5535,7 @@ class Tensor(Tensor_):
Computes matrix multiplication between two tensors by batch.
.. math::
\text{output}[..., :, :] = \text{matrix}(input_x[..., :, :]) * \text{matrix}(mat2[..., :, :])
\text{output}[..., :, :] = \text{matrix}(input_x[..., :, :]) * \text{matrix}(mat2[..., :, :])
The first input tensor must be not less than `3` and the second input must be not less than `2`.

View File

@ -3388,9 +3388,10 @@ def std(input_x, axis=(), unbiased=True, keep_dims=False):
A tuple (output_std, output_mean) containing the standard deviation and mean.
Raises:
TypeError: If `keep_dims` is not a bool.
TypeError: If `input_x` is not a Tensor.
ValueError: If `axis` is not one of the following: int, tuple or list.
TypeError: If `axis` is not one of the following: int, tuple or list.
TypeError: If `keep_dims` is not a bool.
ValueError: If `axis` is out of range.
Supported Platforms:
``Ascend`` ``CPU``

View File

@ -2281,28 +2281,7 @@ class ReduceStd(Primitive):
Returns the standard-deviation and mean of each row of the input tensor in the dimension `axis`.
If `axis` is a list of dimensions, reduce over all of them.
Args:
keep_dims (bool): Whether the output tensor has dim retained or not.
If true, keep these reduced dimensions and the length is 1.
If false, don't keep these dimensions.
unbiased (bool): Whether to use Bessels correction.
If true, will use the Bessel correction unbiased estimation.
If false, will through the biased estimation to calculate the standard deviation.
axis (Union[int, tuple(int), list(int)]): The dimensions to reduce. Default: (), reduce all dimensions.
Only constant value is allowed.
Must be in the range [-rank(`input_x`), rank(`input_x`)).
Inputs:
- **input_x** (Tensor[Number]) - The input tensor. The dtype of the tensor to be reduced is number.
:math:`(N,*)` where :math:`*` means, any number of additional dimensions.
Outputs:
A tuple (output_std, output_mean) containing the standard deviation and mean.
Raises:
TypeError: If `keep_dims` is not a bool.
TypeError: If `input_x` is not a Tensor.
ValueError: If `axis` is not one of the following: int, tuple or list.
Refer to :func:`mindspore.ops.std` for more detail.
Supported Platforms:
``Ascend`` ``CPU``

View File

@ -573,7 +573,7 @@ class SparseTensorDenseAdd(Primitive):
The shape should be :math:`(n,)`.
- **x1_shape** (tuple(int)) - A positive int tuple which specifies the shape of sparse tensor,
should have 2 elements, represent sparse tensor shape is :math:`(N, C)`.
-**x2** (Tensor)- A dense Tensor, the dtype is same as `values`.
- **x2** (Tensor) - A dense Tensor, the dtype is same as `values`.
Returns:
Tensor, add result of sparse tensor and dense tensor. The dtype is same as `values`,