!9116 Fix some error format of comments for web api.

From: @zhang_yi2020
Reviewed-by: @gemini524,@liangchenghui
Signed-off-by: @liangchenghui
This commit is contained in:
mindspore-ci-bot 2020-12-02 13:59:15 +08:00 committed by Gitee
commit c1100f1ab7
10 changed files with 27 additions and 18 deletions

View File

@ -293,11 +293,11 @@ class Tensor(Tensor_):
def view(self, *shape):
"""
r"""
Reshape the tensor according to the input shape.
Args:
shape (Union(list(int), *int)): Dimension of the output tensor.
shape (Union(list[int], \*int)): Dimension of the output tensor.
Returns:
Tensor, has the same dimension as the input shape.

View File

@ -539,11 +539,10 @@ def set_context(**kwargs):
- training_trace: collect iterative trajectory data, that is, the training task and software information of
the AI software stack, to achieve performance analysis of the training task, focusing on data
enhancement, forward and backward calculation, gradient aggregation update and other related data.
- task_trace: collect task trajectory data, that is, the hardware information of the HWTS/AICore of
the Ascend 910 processor, and analyze the information of beginning and ending of the task.
- op_trace: collect single operator performance data.
The profiling can choose the combination of `training_trace`, `task_trace`,
`training_trace` and `task_trace` combination, and eparated by colons;
a single operator can choose `op_trace`, `op_trace` cannot be combined with

View File

@ -151,8 +151,9 @@ class Dataset:
def parse_tree(self):
"""
Internal method to parse the API tree into an IR tree.
Returns:
DatasetNode. The root of the IR tree.
DatasetNode, The root of the IR tree.
"""
if len(self.parent) > 1:
raise ValueError("The data pipeline is not a tree (i.e., one node has 2 consumers)")
@ -823,7 +824,7 @@ class Dataset:
ValueError: If sizes is list of float and not all floats are between 0 and 1, or if the
floats dont sum to 1.
Returns
Returns:
tuple(Dataset), a tuple of datasets that have been split.
Examples:
@ -1516,10 +1517,10 @@ class Dataset:
"""
Get the class index.
Return:
Returns:
Dict, A str-to-int mapping from label name to index.
Dict, A str-to-list<int> mapping from label name to index for Coco ONLY. The second number
in the list is used to indicate the super category
in the list is used to indicate the super category
"""
if self.children:
return self.children[0].get_class_indexing()
@ -1710,7 +1711,7 @@ class MappableDataset(SourceDataset):
ValueError: If sizes is list of float and not all floats are between 0 and 1, or if the
floats dont sum to 1.
Returns
Returns:
tuple(Dataset), a tuple of datasets that have been split.
Examples:
@ -4064,7 +4065,7 @@ class ManifestDataset(MappableDataset):
"""
Get the class index.
Return:
Returns:
Dict, A str-to-int mapping from label name to index.
"""
if self.class_indexing is None:
@ -4720,7 +4721,7 @@ class VOCDataset(MappableDataset):
"""
Get the class index.
Return:
Returns:
Dict, A str-to-int mapping from label name to index.
"""
if self.task != "Detection":
@ -4911,7 +4912,7 @@ class CocoDataset(MappableDataset):
"""
Get the class index.
Return:
Returns:
Dict, A str-to-list<int> mapping from label name to index
"""
if self.task not in {"Detection", "Panoptic"}:

View File

@ -61,7 +61,7 @@ class Occlusion(PerturbationAttribution):
Inputs:
- **inputs** (Tensor) - The input data to be explained, a 4D tensor of shape :math:`(N, C, H, W)`.
- **targets** (Tensor, int) - The label of interest. It should be a 1D or 0D tensor, or an integer.
If it is a 1D tensor, its length should be the same as `inputs`.
If it is a 1D tensor, its length should be the same as `inputs`.
Outputs:
Tensor, a 4D tensor of shape :math:`(N, 1, H, W)`.

View File

@ -365,8 +365,12 @@ class FastGelu(Cell):
Applies FastGelu function to each element of the input. The input is a Tensor with any valid shape.
FastGelu is defined as:
:math:`FastGelu(x_i) = \frac {x_i} {1 + \exp(-1.702 * \left| x_i \right|)} *
\exp(0.851 * (x_i - \left| x_i \right|))`, where :math:`x_i` is the element of the input.
.. math::
FastGelu(x_i) = \frac {x_i} {1 + \exp(-1.702 * \left| x_i \right|)} *
\exp(0.851 * (x_i - \left| x_i \right|))
where :math:`x_i` is the element of the input.
Inputs:
- **input_data** (Tensor) - The input of FastGelu with data type of float16 or float32.

View File

@ -221,7 +221,8 @@ class SoftmaxCrossEntropyWithLogits(_Loss):
.. math::
\ell(x_i, t_i) = - \log\left(\frac{\exp(x_{t_i})}{\sum_j \exp(x_j)}\right)
= -x_{t_i} + \log\left(\sum_j \exp(x_j)\right),
= -x_{t_i} + \log\left(\sum_j \exp(x_j)\right)
where :math:`x_i` is a 1D score Tensor, :math:`t_i` is a scalar.
Note:

View File

@ -91,7 +91,8 @@ class MSE(Metric):
norm) between each element in the input: :math:`x` and the target: :math:`y`.
.. math::
\text{MSE}(x,\ y) = \frac{\sum_{i=1}^n(y_i - x_i)^2}{n},
\text{MSE}(x,\ y) = \frac{\sum_{i=1}^n(y_i - x_i)^2}{n}
where :math:`n` is batch size.
Examples:

View File

@ -26,6 +26,7 @@ class PowerTransform(Bijector):
.. math::
Y = g(X) = (1 + X * c)^{1 / c}, X >= -1 / c
where c >= 0 is the power.
The power transform maps inputs from `[-1/c, inf]` to `[0, inf]`.

View File

@ -25,6 +25,7 @@ class ScalarAffine(Bijector):
.. math::
Y = a * X + b
where a is the scale factor and b is the shift factor.
Args:

View File

@ -2610,6 +2610,7 @@ class StridedSlice(PrimitiveWithInfer):
Outputs:
Tensor.
The output is explained by following example.
- In the 0th dimension, begin is 1, end is 2, and strides is 1,
because :math:`1+1=2\geq2`, the interval is :math:`[1,2)`.
Thus, return the element with :math:`index = 1` in 0th dimension, i.e., [[3, 3, 3], [4, 4, 4]].
@ -2624,7 +2625,7 @@ class StridedSlice(PrimitiveWithInfer):
Supported Platforms:
``Ascend`` ``GPU`` ``CPU``
Examples
Examples:
>>> input_x = Tensor([[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]],
... [[5, 5, 5], [6, 6, 6]]], mindspore.float32)
>>> slice = ops.StridedSlice()