fix the format of document for Unique, LRN, thor, etc.

This commit is contained in:
wangshuide2020 2021-11-03 16:43:17 +08:00
parent 0f6e245dd4
commit 097f141b63
8 changed files with 15 additions and 13 deletions

View File

@ -339,7 +339,7 @@ class LSTMCell(Cell):
mindspore.float16 and shape (num_directions, batch_size, `hidden_size`).
- **c** - data type mindspore.float32 or
mindspore.float16 and shape (num_directions, batch_size, `hidden_size`).
The data type of `h' and 'c' must be the same of `x`.
The data type of `h` and `c` must be the same of `x`.
- **w** - data type mindspore.float32 or
mindspore.float16 and shape (`weight_size`, 1, 1).
The value of `weight_size` depends on `input_size`, `hidden_size` and `bidirectional`

View File

@ -393,9 +393,11 @@ class BatchNorm2d(_BatchNorm):
The implementation of BatchNorm is different in graph mode and pynative mode, therefore that mode can not be
changed after net was initialized.
Note that the formula for updating the moving_mean and moving_var is
.. math::
\text{moving_mean}=\text{moving_meanmomentum}+μ_β\text{(1momentum)}\\
\text{moving_var}=\text{moving_varmomentum}+σ^2\text{(1momentum)}
where :math:`moving_mean, moving_var` are the updated mean and variance,
:math:`μ_β, σ^2` are the observed value (mean and variance) of each batch of data.

View File

@ -260,8 +260,8 @@ class MSELoss(LossBase):
.. math::
\ell(x, y) =
\begin{cases}
\operatorname{mean}(L), & \text{if reduction} = \text{`mean';}\\
\operatorname{sum}(L), & \text{if reduction} = \text{`sum'.}
\operatorname{mean}(L), & \text{if reduction} = \text{'mean';}\\
\operatorname{sum}(L), & \text{if reduction} = \text{'sum'.}
\end{cases}
Args:

View File

@ -320,7 +320,7 @@ def thor(net, learning_rate, damping, momentum, weight_decay=0.0, loss_scale=1.0
Raises:
TypeError: If `learning_rate` is not Tensor.
TypeError: If `loss_scale`,`momentum` or `frequency` is not a float.
TypeError: If `loss_scale`, `momentum` or `frequency` is not a float.
TypeError: If `weight_decay` is neither float nor int.
TypeError: If `use_nesterov` is not a bool.
ValueError: If `loss_scale` is less than or equal to 0.

View File

@ -97,7 +97,7 @@ class SparseTensorDenseMatmul(Cell):
Raises:
TypeError: If the type of `adjoint_st` or `adjoint_dt` is not bool, or the dtype of `indices`,
dtype of `values` and dtype of `dense` don't meet the parameter description.
ValueError: If `sparse_shape`, shape of `indices, shape of `values`,
ValueError: If `sparse_shape`, shape of `indices`, shape of `values`,
and shape of `dense` don't meet the parameter description.
Supported Platforms:

View File

@ -139,7 +139,7 @@ def _check_infer_attr_reduce(axis, keep_dims, prim_name):
class ExpandDims(PrimitiveWithInfer):
"""
Adds an additional dimension to 'input_x` at the given axis.
Adds an additional dimension to `input_x` at the given axis.
Note:
If the specified axis is a negative number, the index is counted
@ -783,7 +783,7 @@ class Unique(Primitive):
The shape is :math:`(N,*)` where :math:`*` means, any number of additional dimensions.
Outputs:
Tuple, containing Tensor objects `(y, idx), `y` is a tensor with the
Tuple, containing Tensor objects (`y`, `idx`), `y` is a tensor with the
same type as `input_x`, and contains the unique elements in `x`, sorted in
ascending order. `idx` is a tensor containing indices of elements in
the input corresponding to the output tensor.
@ -999,7 +999,7 @@ class UniqueWithPad(PrimitiveWithInfer):
Returns unique elements and relative indexes in 1-D tensor, filled with padding num.
The basic function is the same as the Unique operator, but the UniqueWithPad operator adds a Pad function.
The returned tuple(`y`,`idx`) after the input Tensor `x` is processed by the unique operator,
The returned tuple(`y`, `idx`) after the input Tensor `x` is processed by the unique operator,
in which the shapes of `y` and `idx` are mostly not equal. Therefore, in order to solve the above situation,
the UniqueWithPad operator will fill the `y` Tensor with the `pad_num` specified by the user
to make it have the same shape as the Tensor `idx`.

View File

@ -7668,9 +7668,9 @@ class DynamicRNN(PrimitiveWithInfer):
Inputs:
- **x** (Tensor) - Current words. Tensor of shape :math:`(num\_step, batch\_size, input\_size)`.
The data type must be float16.
- **w** (Tensor) - Weight. Tensor of shape :math:`(input\_size + hidden\_size, 4 x hidden\_size)`.
- **w** (Tensor) - Weight. Tensor of shape :math:`(input\_size + hidden\_size, 4 * hidden\_size)`.
The data type must be float16.
- **b** (Tensor) - Bias. Tensor of shape :math`(4 x hidden\_size)`.
- **b** (Tensor) - Bias. Tensor of shape :math:`(4 * hidden\_size)`.
The data type must be float16 or float32.
- **seq_length** (Tensor) - The length of each batch. Tensor of shape :math:`(batch\_size, )`.
Only `None` is currently supported.
@ -8042,7 +8042,7 @@ class LRN(PrimitiveWithInfer):
where the :math:`a_{c}` indicates the represents the specific value of the pixel corresponding to c in feature map;
where the :math:`n/2` indicate the `depth_radius`; where the :math:`k` indicate the `bias`;
where the :math:`\alpha` indicate the`alpha`; where the :math:`\beta` indicate the `beta`.
where the :math:`\alpha` indicate the `alpha`; where the :math:`\beta` indicate the `beta`.
Args:
depth_radius (int): Half-width of the 1-D normalization window with the shape of 0-D. Default: 5.

View File

@ -40,7 +40,7 @@ class SparseToDense(PrimitiveWithInfer):
Raises:
TypeError: If the dtype of `indices` is neither int32 nor int64.
ValueError: If `sparse_shape`, shape of `indices and shape of `values` don't meet the parameter description.
ValueError: If `sparse_shape`, shape of `indices` and shape of `values` don't meet the parameter description.
Supported Platforms:
``CPU``
@ -119,7 +119,7 @@ class SparseTensorDenseMatmul(PrimitiveWithInfer):
Raises:
TypeError: If the type of `adjoint_st` or `adjoint_dt` is not bool, or the dtype of `indices`,
dtype of `values` and dtype of `dense` don't meet the parameter description.
ValueError: If `sparse_shape`, shape of `indices, shape of `values`,
ValueError: If `sparse_shape`, shape of `indices`, shape of `values`,
and shape of `dense` don't meet the parameter description.
Supported Platforms: