modify the inconsistence of files

This commit is contained in:
huanxiaoling 2022-10-12 17:20:15 +08:00
parent 38997c0f38
commit 9e86788b84
16 changed files with 39 additions and 24 deletions

View File

@ -13,4 +13,9 @@ mindspore.Tensor.flatten
异常:
- **TypeError** - `order` 不是字符串类型。
- **ValueError** - `order` 是字符串类型,但不是'C'或'F'。
- **ValueError** - `order` 是字符串类型,但不是'C'或'F'。
比如:
:func:`mindspore.Tensor.reshape`在不改变数据的情况改变Tensor的shape。
:func:`mindspore.Tensor.ravel`返回一个连续扁平化的Tensor。

View File

@ -19,7 +19,7 @@ mindspore.ops.ApplyRMSProp
:math:`m_{t+1}``moment` :math:`m_{t}` 为上一步的 :math:`m_{t+1}`
:math:`\rho``decay`:math:`\beta` 为动量项 `momentum`
:math:`\epsilon` 是避免零为除数的平滑项 `epsilon`
:math:`\eta``learning_rate` :math:`\nabla Q_{i}(w)` 代表 `grad`
:math:`\eta``learning_rate` :math:`\nabla Q_{i}(w)` 代表 `grad`
.. warning::
在该算法的稠密实现版本中,"mean_square"和"momemt"即使"grad"为零将仍被更新。但在该稀疏实现版本中,在"grad"为零的迭代"mean_squre"和"moment"将不被更新。

View File

@ -8,7 +8,7 @@ mindspore.ops.ScatterMax
根据指定更新值和输入索引通过最大值操作更新输入数据的值。
该操作在更新完成后输出 `input_x` ,这样方便使用更新后的值。
对于 `indices.shape` 的每个 `i, ..., j`
对于 `indices.shape` 的每个 :math:`i, ..., j`
.. math::
\text{input_x}[\text{indices}[i, ..., j], :]

View File

@ -5,7 +5,7 @@ mindspore.ops.adaptive_avg_pool2d
2维自适应平均池化。
对输入Tensor提供2维的自适应平均池化操作也就是说对于输入任何尺寸指定输出的尺寸都为H * W。但是输入和输出特征的数目不会变化。
对输入Tensor提供2维的自适应平均池化操作也就是说对于输入任何尺寸指定输出的尺寸都为H * W。但是输入和输出特征的数目不会变化。
输入和输出数据格式可以是"NCHW"和"CHW"。N是批处理大小C是通道数H是特征高度W是特征宽度。

View File

@ -3,7 +3,7 @@ mindspore.ops.gumbel_softmax
.. py:function:: mindspore.ops.gumbel_softmax(logits, tau=1, hard=False, dim=-1)
返回Gumbel-Softmax分布的Tensor`hard = True` 的时候返回one-hot形式的离散型Tensor`hard = False` 时返回在dim维进行过softmax的Tensor。
返回Gumbel-Softmax分布的Tensor`hard = True` 的时候返回one-hot形式的离散型Tensor`hard = False` 时返回在dim维进行过softmax的Tensor。
参数:
- **logits** (Tensor) - 输入是一个非标准化的对数概率分布。只支持float16和float32。

View File

@ -3,7 +3,7 @@
.. py:function:: mindspore.ops.sequence_mask(lengths, maxlen=None)
返回一个表示每个单元的前N个位置的掩码Tensor内部元素数据类型为bool。
返回一个表示每个单元的前N个位置的掩码Tensor内部元素数据类型为bool。
如果 `lengths` 的shape为 :math:`(d_1, d_2, ..., d_n)` 则生成的Tensor掩码拥有数据类型其shape为 :math:`(d_1, d_2, ..., d_n, maxlen)` 且mask :math:`[i_1, i_2, ..., i_n, j] = (j < lengths[i_1, i_2, ..., i_n])`

View File

@ -5,7 +5,7 @@ mindspore.ops.split
根据指定的轴和分割数量对输入Tensor进行分割。
`input_x` Tensor将被分割为相同shape的子Tensor,且要求 `input_x.shape(axis)` 可被 `output_num` 整除。
`input_x` Tensor将被分割为相同shape的子Tensor要求 `input_x.shape(axis)` 可被 `output_num` 整除。
参数:
- **input_x** (Tensor) - Tensor的shape为 :math:`(x_1, x_2, ..., x_R)`

View File

@ -6,7 +6,7 @@ mindspore.ops.unique_with_pad
对输入一维张量中元素去重返回一维张量中的唯一元素使用pad_num填充和相对索引。
基本操作与unique相同但unique_with_pad多了pad操作。
unique运算符对张量处理后所返回的元组 `y` `idx` `y``idx` 的shape通常会有差别因此,为了解决上述情况,
unique运算符对张量处理后所返回的元组 `y` `idx` `y``idx` 的shape通常会有差别因此,为了解决上述情况,
unique_with_pad操作符将用用户指定的 `pad_num` 填充 `y` 张量,使其具有与张量 `idx` 相同的形状。
参数:

View File

@ -111,9 +111,11 @@ class Caltech101Dataset(GeneratorDataset):
A source dataset that reads and parses Caltech101 dataset.
The columns of the generated dataset depend on the value of `target_type`.
When `target_type` is 'category', the columns are :py:obj:`[image, category]`.
When `target_type` is 'annotation', the columns are :py:obj:`[image, annotation]`.
When `target_type` is 'all', the columns are :py:obj:`[image, category, annotation]`.
- When `target_type` is 'category', the columns are :py:obj:`[image, category]`.
- When `target_type` is 'annotation', the columns are :py:obj:`[image, annotation]`.
- When `target_type` is 'all', the columns are :py:obj:`[image, category, annotation]`.
The tensor of column :py:obj:`image` is of the uint8 type.
The tensor of column :py:obj:`category` is of the uint32 type.
The tensor of column :py:obj:`annotation` is a 2-dimensional ndarray that stores the contour of the image
@ -3789,8 +3791,9 @@ class SBDataset(GeneratorDataset):
A source dataset that reads and parses Semantic Boundaries Dataset.
The generated dataset has two columns: :py:obj:`[image, task]`.
The tensor of column :py:obj:`image` is of the uint8 type.
The tensor of column :py:obj:`task` contains 20 images of the uint8 type if `task` is 'Boundaries' otherwise
- The tensor of column :py:obj:`image` is of the uint8 type.
- The tensor of column :py:obj:`task` contains 20 images of the uint8 type if `task` is 'Boundaries' otherwise
contains 1 image of the uint8 type.
Args:

View File

@ -28,7 +28,11 @@ class Poisson(Distribution):
r"""
Poisson Distribution.
A Poisson Distribution is a discrete distribution with the range as the non-negative integers,
and the probability mass function as :math:`P(X = k) = \lambda^k \exp(-\lambda) / k!, k = 1, 2, ...`,
and the probability mass function as
.. math::
P(X = k) = \lambda^k \exp(-\lambda) / k!, k = 1, 2, ...
where :math:`\lambda` is the rate of the distribution.
Args:

View File

@ -134,7 +134,7 @@ def sequence_mask(lengths, maxlen=None):
Returns a mask tensor representing the first N positions of each cell.
If `lengths` has shape (d_1, d_2, ..., d_n), then the resulting tensor mask has type and shape
(d_1, d_2, ..., d_n, maxlen), with mask[i_1, i_2, ..., i_n, j] = (j < lengths[i_1, i_2, ..., i_n])
(d_1, d_2, ..., d_n, maxlen), with mask[i_1, i_2, ..., i_n, j] = (j < lengths[i_1, i_2, ..., i_n]).
Args:
lengths (Tensor): Tensor to calculate the mask for. All values in this tensor should be

View File

@ -1159,7 +1159,7 @@ def strided_slice(input_x,
Raises:
TypeError: If `begin_mask`, `end_mask`, `ellipsis_mask`, `new_axis_mask` or
`shrink_axis_mask` is not an int.
TypeError: If `begin` `end` or `strides` is not tuple[int].
TypeError: If `begin`, `end` or `strides` is not tuple[int].
ValueError: If `begin_mask`, `end_mask`, `ellipsis_mask`, `new_axis_mask` or
`shrink_axis_mask` is less than 0.
@ -1229,8 +1229,8 @@ def slice(input_x, begin, size):
r"""
Slices a tensor in the specified shape.
Slice the tensor `input_x` in shape of `size` and starting at the location specified by `begin`,
The slice `begin` represents the offset in each dimension of `input_x`,
Slice the tensor `input_x` in shape of `size` and starting at the location specified by `begin`.
The slice `begin` represents the offset in each dimension of `input_x`.
The slice `size` represents the size of the output tensor.
Note:
@ -1784,7 +1784,8 @@ def scatter_div(input_x, indices, updates):
Inputs of `input_x` and `updates` comply with the implicit type conversion rules to make the data types consistent.
If they have different data types, the lower priority data type will be converted to
the relatively highest priority data type.
the relatively highest priority data type. A RuntimeError will be reported
when `updates` does not support conversion to the data type required by `input_x`.
Args:
input_x (Parameter): The target tensor, with data type of Parameter.

View File

@ -2245,7 +2245,7 @@ def max_pool3d(x, kernel_size, stride=None, padding=0, dilation=1, ceil_mode=Fal
Typically the input is a Tensor with shape :math:`(N_{in}, C_{in}, D_{in}, H_{in}, W_{in})`, outputs
regional maximum in the :math:`(D_{in}, H_{in}, W_{in})`-dimension. Given `kernel_size`
:math:`ks = (d_{ker}, h_{ker}, w_{ker})` and `stride` :math:`s = (s_0, s_1, s_2)`, the operation is as follows.
:math:`ks = (d_{ker}, h_{ker}, w_{ker})` and `stride` :math:`s = (s_0, s_1, s_2)`, the operation is as follows:
.. math::
\text{output}(N_i, C_j, d, h, w) =

View File

@ -152,7 +152,7 @@ def assign_add(variable, value):
def index_add(x, indices, y, axis, use_lock=True, check_index_bound=True):
"""
Adds tensor `y` to specified axis and indices of Parameter `x`. The axis should be in [0, len(x.dim) - 1],
and indices should be in [0, the size of `x` - 1] at the axis dimension.
and indices should be in [0, x.shape[axis] - 1] at the axis dimension.
Args:
x (Parameter): The input Parameter to add to.

View File

@ -1004,7 +1004,7 @@ class Unique(Primitive):
The shape of Tensor `y` and Tensor `idx` is different in most cases, because Tensor `y` will be duplicated,
and the shape of Tensor `idx` is consistent with the input.
To get the same shape between `idx` and `y`, please ref to 'UniqueWithPad' operator.
To get the same shape between `idx` and `y`, please refer to :class:`mindspore.ops.UniqueWithPad`.
Inputs:
- **input_x** (Tensor) - The input tensor.
@ -5982,6 +5982,7 @@ class EmbeddingLookup(PrimitiveWithCheck):
raise ValueError(f"For '{self.name}', the dimension of 'input_params' must <= 2, "
f"but got {len(params_shp)}.")
class GatherD(Primitive):
"""
Gathers elements along an axis specified by dim.
@ -6545,7 +6546,7 @@ class TensorScatterAdd(Primitive):
Creates a new tensor by adding the values from the positions in `input_x` indicated by
`indices`, with values from `updates`. When multiple values are given for the same
index, the updated result will be the sum of all values. This operation is almost
equivalent to using ScatterNdAdd, except that the updates are applied on output `Tensor`
equivalent to using :class:`mindspore.ops.ScatterNdAdd`, except that the updates are applied on output `Tensor`
instead of input `Parameter`.
Refer to :func:`mindspore.ops.tensor_scatter_add` for more detail.

View File

@ -1516,7 +1516,8 @@ def build_searched_strategy(strategy_filename):
"""
Build strategy of every parameter in network. Used in the case of distributed inference.
For details of it, please check:
`<https://www.mindspore.cn/tutorials/experts/en/master/parallel/save_load.html>`_.
`Saving and Loading Models in Hybrid Parallel Mode
<https://www.mindspore.cn/tutorials/experts/en/master/parallel/save_load.html>`_.
Args:
strategy_filename (str): Name of strategy file.