forked from mindspore-Ecosystem/mindspore
!46075 fix docs format issues
Merge pull request !46075 from luojianing/code_docs_master
This commit is contained in:
commit
ddedbceeed
|
@ -3610,6 +3610,7 @@ def heaviside(x, values):
|
|||
|
||||
Supported Platforms:
|
||||
``GPU`` ``CPU``
|
||||
|
||||
Examples:
|
||||
>>> x = Tensor(np.array([-1.5, 0., 2.]))
|
||||
>>> values = Tensor(np.array([0.5]))
|
||||
|
@ -4073,8 +4074,8 @@ def addr(x, vec1, vec2, beta=1, alpha=1):
|
|||
"""
|
||||
Executes the outer-product of `vec1` and `vec2` and adds it to the matrix `x`.
|
||||
|
||||
If `vec1` is a vector of size :vec1:`N` and `vec2` is a vector of size :vec1:`M`, then `x` must be broadcastable
|
||||
with a matrix of size :vec1:`(N, M)` and `out` will be a matrix of size :vec1:`(N, M)`.
|
||||
If `vec1` is a vector of size :math:`N` and `vec2` is a vector of size :math:`M`, then `x` must be broadcastable
|
||||
with a matrix of size :math:`(N, M)` and `out` will be a matrix of size :math:`(N, M)`.
|
||||
|
||||
The optional values `beta` and `alpha` are the scale factors on the outer product between `vec1` and `vec2`
|
||||
and the added matrix `x` respectively. If `beta` is 0, then `x` will be ignored.
|
||||
|
@ -4083,20 +4084,20 @@ def addr(x, vec1, vec2, beta=1, alpha=1):
|
|||
output = β x + α (vec1 ⊗ vec2)
|
||||
|
||||
Args:
|
||||
x (Tensor): Vector to be added. The shape of the tensor is :vec1:`(N, M)`.
|
||||
vec1 (Tensor): The first tensor to be multiplied. The shape of the tensor is :vec1:`(N,)`.
|
||||
vec2 (Tensor): The second tensor to be multiplied. The shape of the tensor is :vec1:`(M,)`.
|
||||
x (Tensor): Vector to be added. The shape of the tensor is :math:`(N, M)`.
|
||||
vec1 (Tensor): The first tensor to be multiplied. The shape of the tensor is :math:`(N,)`.
|
||||
vec2 (Tensor): The second tensor to be multiplied. The shape of the tensor is :math:`(M,)`.
|
||||
beta (scalar[int, float, bool], optional): Multiplier for `x` (β). The `beta` must be int or
|
||||
float or bool, Default: 1.
|
||||
alpha (scalar[int, float, bool], optional): Multiplier for `vec1` ⊗ `vec2` (α). The `alpha` must
|
||||
be int or float or bool, Default: 1.
|
||||
|
||||
Returns:
|
||||
Tensor, the shape of the output tensor is :vec1:`(N, M)`, has the same dtype as `x`.
|
||||
Tensor, the shape of the output tensor is :math:`(N, M)`, has the same dtype as `x`.
|
||||
|
||||
Raises:
|
||||
TypeError: If `x`, `vec1`, `vec2` is not a Tensor.
|
||||
TypeError: If inputs `x`, `vec1`, 'vec2' are not the same dtype.
|
||||
TypeError: If inputs `x`, `vec1`, `vec2` are not the same dtype.
|
||||
ValueError: If `x` is not a 2-D Tensor.
|
||||
If `vec1`, `vec2` is not a 1-D Tensor.
|
||||
|
||||
|
|
|
@ -7457,7 +7457,7 @@ class FillDiagonal(Primitive):
|
|||
|
||||
Inputs:
|
||||
- **input_x** (Tensor) - The shape of tensor is :math:`(x_1, x_2, ..., x_R)`.
|
||||
The data type must be float32, int32 or int64.
|
||||
The data type must be float32, int32 or int64.
|
||||
|
||||
Outputs:
|
||||
- **y** (Tensor) - Tensor, has the same shape and data type as the input `x`.
|
||||
|
|
|
@ -512,7 +512,7 @@ class Assert(PrimitiveWithInfer):
|
|||
Inputs:
|
||||
- **condition** (Union[Tensor[bool], bool]) - The condition to be identified.
|
||||
- **input_data** (Union[tuple[Tensor], list[Tensor]]) - The tensors to be printed out when the condition
|
||||
is false.
|
||||
is false.
|
||||
|
||||
Raises:
|
||||
TypeError: If `summarize` is not an int.
|
||||
|
|
|
@ -1115,7 +1115,7 @@ class CombinedNonMaxSuppression(Primitive):
|
|||
Raises:
|
||||
TypeError: If the dtype of `boxes`, `scores` , `iou_threshold` , `score threshold` are not float32.
|
||||
TypeError: If the dtype of `max_output_size_per_class` and `max_total_size` are not int32.
|
||||
ValueError: If `boxes`is not 4D.
|
||||
ValueError: If `boxes` is not 4D.
|
||||
ValueError: If `max_output_size_per_class`, `max_total_size`, `iou_threshold` and `score threshold` are not 0D.
|
||||
ValueError: If shape[0] of `boxes` is not same with shape[0] of `scores`.
|
||||
ValueError: If `scores` is not 3D.
|
||||
|
|
|
@ -6607,6 +6607,7 @@ class RaggedRange(Primitive):
|
|||
- if type of the input `starts`, input `limits` and input `deltas`
|
||||
are float32 or float64, shape of the output `rt_dense_values` is equal to
|
||||
sum(ceil(abs((limits[i] - starts[i]) / deltas[i]))).
|
||||
|
||||
Raises:
|
||||
TypeError: If any input is not Tensor.
|
||||
TypeError: If the type of `starts` is not one of the following dtype: int32, int64, float32, float64.
|
||||
|
|
|
@ -10209,12 +10209,14 @@ class FractionalMaxPoolWithFixedKsize(Primitive):
|
|||
- **y** (Tensor) - Has the same type as the `input_x`.
|
||||
Has the shape :math:`(N, C, output\underline{~}shape{H}, output\underline{~}shape{W})`.
|
||||
- **argmax** (Tensor) -A tensor whose data type must be int64. Has the same shape as the `y`.
|
||||
|
||||
Raises:
|
||||
TypeError: If data type of `input_x` is not one of the following: float16, float32, float64, int32, int64.
|
||||
TypeError: If data type of `random_samples` is not one of the following: float16, float32, float64.
|
||||
ValueError: If `ksize` is not a number and `ksize` is not a tuple of length 2.
|
||||
ValueError: If `output_shape` is not a number and `output_shape` is not a tuple of length 2.
|
||||
ValueError: If the sum of `ksize`,`output_shape` and -1 is larger than the corresponding dimension of `input_x`.
|
||||
ValueError: If the sum of `ksize`, `output_shape` and -1 is larger than the corresponding
|
||||
dimension of `input_x`.
|
||||
ValueError: If the dimension of `random_samples` is not 3.
|
||||
ValueError: If the first dimension size of `input_x` and `random_samples` is not equal.
|
||||
ValueError: If the second dimension size of `input_x` and `random_samples` is not equal.
|
||||
|
|
|
@ -283,7 +283,7 @@ class LogNormalReverse(Primitive):
|
|||
|
||||
Inputs:
|
||||
- **input** (Tensor) - The tensor to be generated with log-normal distribution.
|
||||
Must be one of the following types: float16, float32, float64.
|
||||
Must be one of the following types: float16, float32, float64.
|
||||
|
||||
Outputs:
|
||||
Tensor. A Tensor with the same type and shape of input.
|
||||
|
@ -295,7 +295,6 @@ class LogNormalReverse(Primitive):
|
|||
Supported Platforms:
|
||||
``Ascend`` ``GPU`` ``CPU``
|
||||
|
||||
|
||||
Examples:
|
||||
>>> x = Tensor(np.random.randn(3,4),mstype.float64)
|
||||
>>> mean = 2.0
|
||||
|
|
Loading…
Reference in New Issue