forked from mindspore-Ecosystem/mindspore
!49404 modify description of apis aviod of repeat
Merge pull request !49404 from ZhidanLiu/code_docs_master
This commit is contained in:
commit
7c05d1ddcf
|
@ -3,12 +3,12 @@ mindspore.ops.argsort
|
|||
|
||||
.. py:function:: mindspore.ops.argsort(input_x, axis=-1, descending=False)
|
||||
|
||||
返回输入Tensor沿轴按特定顺序排序索引。
|
||||
对输入Tensor沿轴按特定顺序排序并返回排序索引。
|
||||
|
||||
参数:
|
||||
- **input_x** (Tensor) - 待排序的输入Tensor。
|
||||
- **axis** (int) - 指定排序轴。默认值:-1。
|
||||
- **descending** (bool) - 控制输出顺序。如果 `descending` 为True,按照元素值升序排序,否则降顺排序。默认值:False。
|
||||
- **axis** (int) - 指定排序轴。默认值:-1,表示指定最后一维。
|
||||
- **descending** (bool) - 输出顺序。如果 `descending` 为True,按照元素值升序排序,否则降顺排序。默认值:False。
|
||||
|
||||
返回:
|
||||
Tensor,排序后输入Tensor的索引。数据类型为int32。
|
||||
|
|
|
@ -3,8 +3,8 @@ mindspore.ops.max_unpool1d
|
|||
|
||||
.. py:function:: mindspore.ops.max_unpool1d(x, indices, kernel_size, stride=None, padding=0, output_size=None)
|
||||
|
||||
`maxpool1d` 的部分逆过程。 `maxpool1d` 不是完全可逆的,因为非最大值丢失。
|
||||
`max_unpool1d` 以 `maxpool1d` 的输出为输入,包括最大值的索引。在计算 `maxpool1d` 部分逆的过程中,非最大值设置为零。
|
||||
`max_unpool1d` 是 `maxpool1d` 的部分逆过程,因为非最大值丢失。
|
||||
`max_unpool1d` 以 `maxpool1d` 的输出和最大值的索引为输入。然后计算 `maxpool1d` 部分逆的过程,非最大值将设为零。
|
||||
支持的输入数据格式为 :math:`(N, C, H_{in})` 或 :math:`(C, H_{in})` ,输出数据的格式为 :math:`(N, C, H_{out})`
|
||||
或 :math:`(C, H_{out})` ,计算公式如下:
|
||||
|
||||
|
|
|
@ -7,8 +7,14 @@ mindspore.ops.tensor_split
|
|||
|
||||
参数:
|
||||
- **x** (Tensor) - 待分割的Tensor。
|
||||
- **indices_or_sections** (Union[int, tuple(int), list(int)]) - 如果 `indices_or_sections` 是整数类型n,输入将沿 `axis` 轴分割成n份。如果输入沿着 `axis` 轴能被n整除,那么每个切片的大小相同为 :math:`x.size(axis) / n` 。如果不能被n整除,那么前 :math:`x.size(axis) % n` 个切片的大小为 :math:`x.size(axis) // n + 1` ,其余切片的大小为 :math:`x.size(axis) // n` 。
|
||||
如果 `indices_or_sections` 是由int组成list或者tuple,那么输入将沿着 `axis` 轴在tuple或list中的索引处切分。例如::math:`indices\_or\_sections=[2, 3]` 和 :math:`axis=0` 将得到切片 :math:`x[:2]` , :math:`x[2:3]` ,和 :math:`x[3:]` .
|
||||
- **indices_or_sections** (Union[int, tuple(int), list(int)])
|
||||
|
||||
- 如果 `indices_or_sections` 是整数类型n,输入tensor将分割成n份。
|
||||
|
||||
- 如果 :math:`x.size(axis)` 能被n整除,那么子切片的大小相同,为 :math:`x.size(axis) / n` 。
|
||||
- 如果 :math:`x.size(axis)` 不能被n整除,那么前 :math:`x.size(axis) % n` 个切片的大小为 :math:`x.size(axis) // n + 1` ,其余切片的大小为 :math:`x.size(axis) // n` 。
|
||||
|
||||
- 如果 `indices_or_sections` 类型为tuple(int) 或 list(int),那么输入tensor将在tuple或list中的索引处切分。例如:给定参数 :math:`indices\_or\_sections=[1, 4]` 和 :math:`axis=0` 将得到切片 :math:`x[:1]` , :math:`x[1:4]` ,和 :math:`x[4:]` 。
|
||||
- **axis** (int) - 指定分割轴。默认值:0。
|
||||
|
||||
返回:
|
||||
|
|
|
@ -3134,12 +3134,12 @@ def sort(input_x, axis=-1, descending=False):
|
|||
|
||||
def argsort(input_x, axis=-1, descending=False):
|
||||
r"""
|
||||
Return the indices that sort the input tensor along the given dimension in the specified order.
|
||||
Sorts the input tensor along the given dimension in specified order and return the sorted indices.
|
||||
|
||||
Args:
|
||||
input_x(Tensor): The input tensor to sort.
|
||||
axis (int): The dimension to sort along. Default: -1.
|
||||
descending (bool): Controls the sort order. If `descending` is True then the elements
|
||||
axis (int): The axis to sort along. Default: -1, means the last axis
|
||||
descending (bool): The sort order. If `descending` is True then the elements
|
||||
are sorted in descending order by value. Otherwise sort in descending order. Default: False.
|
||||
|
||||
Returns:
|
||||
|
@ -5273,15 +5273,18 @@ def tensor_split(x, indices_or_sections, axis=0):
|
|||
Args:
|
||||
x (Tensor): A Tensor to be divided.
|
||||
indices_or_sections (Union[int, tuple(int), list(int)]):
|
||||
If `indices_or_sections` is an integer n, input is split into
|
||||
n sections along dimension `axis`. If input is divisible by n along dimension `axis`, each section will be
|
||||
of equal size, :math:`x.size(axis) / n` . If input is not divisible by n, the sizes of the first
|
||||
:math:`x.size(axis) % n` sections will have size :math:`x.size(axis) // n + 1` , and the rest will
|
||||
have size :math:`x.size(axis) // n` .
|
||||
If `indices_or_sections` is a list or tuple of ints, then input is split
|
||||
along dimension `axis` at each of the indices in the list, tuple. For instance,
|
||||
:math:`indices\_or\_sections=[2, 3]` and :math:`axis=0` would result in the tensors :math:`x[:2]` ,
|
||||
:math:`x[2:3]` , and :math:`x[3:]` .
|
||||
|
||||
- If `indices_or_sections` is an integer n, input tensor will be split into n sections.
|
||||
|
||||
- If :math:`x.size(axis)` can be divisible by n, sub-sections will have equal size
|
||||
:math:`x.size(axis) / n` .
|
||||
- If :math:`x.size(axis)` is not divisible by n, the first :math:`x.size(axis) % n` sections
|
||||
will have size :math:`x.size(axis) // n + 1` , and the rest will have size :math:`x.size(axis) // n` .
|
||||
|
||||
- If `indices_or_sections` is of type tuple(int) or list(int), the input tensor will be split at the
|
||||
indices in the list or tuple. For example, given parameters :math:`indices\_or\_sections=[1, 4]`
|
||||
and :math:`axis=0` , the input tensor will be split into sections :math:`x[:1]` , :math:`x[1:4]` ,
|
||||
and :math:`x[4:]` .
|
||||
axis (int): The axis along which to split. Default: 0.
|
||||
|
||||
Returns:
|
||||
|
|
|
@ -750,14 +750,12 @@ def adaptive_max_pool3d(input, output_size, return_indices=False):
|
|||
|
||||
def max_unpool1d(x, indices, kernel_size, stride=None, padding=0, output_size=None):
|
||||
r"""
|
||||
Computes a partial inverse of maxpool1d.
|
||||
max_unpool1d is a partial inverse of maxpool1d, since the non-maximal values are lost.
|
||||
|
||||
maxpool1d is not fully invertible, since the non-maximal values are lost.
|
||||
|
||||
max_unpool1d takes the output of maxpool1d as input including the indices of the maximal values
|
||||
and computes a partial inverse in which all non-maximal values are set to zero. Typically the input
|
||||
is of shape :math:`(N, C, H_{in})` or :math:`(C, H_{in})`, and the output is of shape :math:`(N, C, H_{out})`
|
||||
or :math:`(C, H_{out})`. The operation is as follows.
|
||||
max_unpool1d takes the output of maxpool1d and indices of the maximal values as input.
|
||||
It computes a partial inverse of maxpool1d with all non-maximal values will be set to zero.
|
||||
Typically the input is of shape :math:`(N, C, H_{in})` or :math:`(C, H_{in})`, and the output is of shape
|
||||
:math:`(N, C, H_{out})` or :math:`(C, H_{out})`. The operation is as follows.
|
||||
|
||||
.. math::
|
||||
\begin{array}{ll} \\
|
||||
|
|
Loading…
Reference in New Issue