fix params issues

This commit is contained in:
luojianing 2022-09-20 17:41:37 +08:00
parent 2889f726e9
commit ff4ee30658
11 changed files with 44 additions and 41 deletions

View File

@ -20,7 +20,7 @@ mindspore.ops.batch_to_space_nd
参数:
- **input_x** (Tensor) - 输入张量必须大于或者等于四维Ascend平台必须为4维。批次维度需能被 `block_shape` 整除。支持数据类型float16和float32。
- **block_shape** (list[int], tuple[int], int) - 分割批次维度的块的数量取值需大于1。
- **block_shape** (Union[list(int), tuple(int), int]) - 分割批次维度的块的数量取值需大于1。如果 `block_shape` 为list或者tuple其长度 `M` 为空间维度的长度。如果 `block_shape` 为整数,那么所有空间维度分割的个数均为 `block_shape``M` 必须为2。
- **crops** (tuple, list) - 空间维度的裁剪大小包含两个长度为2的list分别对应空间维度H和W。取值需大于或等于0同时要求 `input_shape[i+2] * block_shape[i] > crops[i][0] + crops[i][1]`
返回:

View File

@ -28,7 +28,7 @@ mindspore.ops.deformable_conv2d
- **dilations** (tuple[int], 可选) - 一个包含四个整数的元组,表示对于输入的每个维度的膨胀系数。其维度顺序依据 `x` 的数据格式对应N和C维度的值必须设置成1。默认值为(1, 1, 1, 1)。
- **groups** (int, 可选) - 一个int32类型的整数表示从输入通道到输出通道的阻塞连接数。输入通道数和输出通道数必须都能被 `groups` 整除。默认值为1。
- **deformable_groups** (int, 可选) - 一个int32类型的整数表示可变形卷积组数。输入通道数必须能被 `deformable_groups` 整除。默认值为1。
- **modulated** (int, 可选) - 指定可变形二维卷积的版本。True表示v2False表示v1。当前只支持设置为v2版本。默认值为True。
- **modulated** (bool, 可选) - 指定可变形二维卷积的版本。True表示v2False表示v1。当前只支持设置为v2版本。默认值为True。
返回:
Tensor一个四维Tensor表示输出特征图。数据类型与 `x` 相同,数据格式为"NCHW"shape为 :math:`(N, C_{out}, H_{out}, W_{out})`

View File

@ -12,7 +12,7 @@ mindspore.ops.dropout2d
`dropout2d` 可以提高通道特征映射之间的独立性。
参数:
- **x** (tensor) - 一个形状为 :math:`(N, C, H, W)``4D` Tensor其中N是批处理大小`C` 是通道数,`H` 是特征高度,`W` 是特征宽度。其数据类型应为int8、int16、int32、int64、float16、float32或float64。
- **x** (Tensor) - 一个形状为 :math:`(N, C, H, W)``4D` Tensor其中N是批处理大小`C` 是通道数,`H` 是特征高度,`W` 是特征宽度。其数据类型应为int8、int16、int32、int64、float16、float32或float64。
- **p** (float) - 通道的丢弃概率,介于 0 和 1 之间,例如 `p` = 0.8意味着80%的清零概率。默认值0.5。
返回:

View File

@ -11,7 +11,7 @@ mindspore.ops.dropout3d
`dropout3d` 可以提高通道特征映射之间的独立性。
参数:
- **x** (tensor) - 一个形状为 :math:`(N, C, D, H, W)``5D` Tensor其中N是批处理大小`C` 是通道数,`D` 是特征深度, `H` 是特征高度,`W` 是特征宽度。其数据类型应为int8、int16、int32、int64、float16、float32或float64。
- **x** (Tensor) - 一个形状为 :math:`(N, C, D, H, W)``5D` Tensor其中N是批处理大小`C` 是通道数,`D` 是特征深度, `H` 是特征高度,`W` 是特征宽度。其数据类型应为int8、int16、int32、int64、float16、float32或float64。
- **p** (float) - 通道的丢弃概率,介于 0 和 1 之间,例如 `p` = 0.8意味着80%的清零概率。默认值0.5。
返回:

View File

@ -12,7 +12,7 @@ mindspore.ops.expand_dims
参数:
- **input_x** (Tensor) - 输入Tensorshape为 :math:`(x_1, x_2, ..., x_R)`
- **axis** (Union[int, list(int), tuple(int)]) - 新插入的维度的位置。`axis` 的值必须在范围 `[-input_x.ndim-1, input_x.ndim]` 内。仅接受常量输入。
- **axis** (int) - 新插入的维度的位置。`axis` 的值必须在范围 `[-input_x.ndim-1, input_x.ndim]` 内。仅接受常量输入。
返回:
Tensor维度在指定轴扩展之后的Tensor`input_x` 的数据类型相同。如果 `axis` 是0那么它的shape为 :math:`(1, x_1, x_2, ..., x_R)`

View File

@ -10,7 +10,7 @@ mindspore.ops.pdist
y[n] = \sqrt[p]{{\mid x_{i} - x_{j} \mid}^p}
参数:
- **x** (tensor) - 输入tensor x其shape为 :math:`(*B, N, M)`,其中 :math:`*B` 表示批处理大小可以是多维度。类型float16float32或float64。
- **x** (Tensor) - 输入tensor x其shape为 :math:`(*B, N, M)`,其中 :math:`*B` 表示批处理大小可以是多维度。类型float16float32或float64。
- **p** (float) - p-范数距离的p值:math:`p∈[0∞]`。默认值2.0。
返回:

View File

@ -19,8 +19,8 @@ mindspore.ops.space_to_batch_nd
参数:
- **input_x** (Tensor) - 输入张量Ascend平台必须为四维。
- **block_size** (list[int], tuple[int], int) - 块形状描述空间维度为分割的个数。如果 `block_size` 为list或者tuple其长度 `M` 为空间维度的长度。如果 `block_size` 为整数,那么所有空间维度分割的个数均为 `block_size` 。在Ascend后端 `M` 必须为2。
- **paddings** (tuple, list) - 空间维度的填充大小。
- **block_size** (Union[list(int), tuple(int), int]) - 块形状描述空间维度为分割的个数。如果 `block_size` 为list或者tuple其长度 `M` 为空间维度的长度。如果 `block_size` 为整数,那么所有空间维度分割的个数均为 `block_size` 。在Ascend后端 `M` 必须为2。
- **paddings** (Union[tuple, list]) - 空间维度的填充大小。
返回:
Tensor经过划分排列之后的结果。

View File

@ -3012,25 +3012,27 @@ def matrix_diag(x, k=0, num_rows=-1, num_cols=-1, padding_value=0, align="RIGHT_
Args:
x (Tensor): The diagonal Tensor.
k (Union[int, Tensor], optional): A Tensor of type int32. Diagonal offsets. Positive value means superdiagonal,
0 refers to the main diagonal, and negative value means subdiagonals. `k` can be a single integer
(for a single diagonal) or a pair of integers specifying the low and high ends of a matrix band. k[0] must not
be larger than k[1]. The value must be in the range of given or derivated `num_rows` and `num_cols`, meaning
value of k must be in (-num_rows, num_cols). Default: 0.
0 refers to the main diagonal, and negative value means subdiagonals. `k` can be a single integer
(for a single diagonal) or a pair of integers specifying the low and high ends of a matrix band.
k[0] must not be larger than k[1]. The value must be in the range of given or derivated `num_rows`
and `num_cols`, meaning value of k must be in (-num_rows, num_cols). Default: 0.
num_rows (Union[int, Tensor], optional): A Tensor of type int32 with only one value. The number of rows of the
output Tensor. If `num_rows` is -1, indicating that the innermost matrix of the output Tensor is a square
matrix, and the real number of rows will be derivated by other inputs. That is
:math:`num_rows = x.shape[-1] - min(k[1], 0)`. Otherwise, the value must be equal or greater than
:math:`x.shape[-1] - min(k[1], 0)`. Default: -1.
num_cols (Union[int, Tensor], optional): A Tensor of type int32 with only one value. The number of columns of
the output Tensor. If `num_cols` is -1, indicating that the innermost matrix of the output Tensor is a square
matrix, and the real number of columns will be derivated by other inputs. That is
:math:`num_cols = x.shape[-1] + max(k[0], 0)`. Otherwise, the value must be equal or greater than
:math:`x.shape[-1] - min(k[1], 0)`. Default: -1.
output Tensor. If `num_rows` is -1, indicating that the innermost matrix of the output Tensor is a square
matrix, and the real number of rows will be derivated by other inputs. That is
:math:`num_rows = x.shape[-1] - min(k[1], 0)`. Otherwise, the value must be equal or greater than
:math:`x.shape[-1] - min(k[1], 0)`. Default: -1.
num_cols (Union[int, Tensor], optional): A Tensor of type int32 with only one value.
The number of columns of
the output Tensor. If `num_cols` is -1, indicating that the innermost matrix of the output
Tensor is a square matrix, and the real number of columns will be derivated by other inputs.
That is :math:`num_cols = x.shape[-1] + max(k[0], 0)`. Otherwise, the value must be equal or
greater than :math:`x.shape[-1] - min(k[1], 0)`. Default: -1.
padding_value (Union[int, float, Tensor], optional): A Tensor with only one value. Have the same dtype as x.
The number to fill the area outside the specified diagonal band. Default: 0.
align (str): An optional string from: "RIGHT_LEFT"(default), "LEFT_RIGHT", "LEFT_LEFT", "RIGHT_RIGHT". Align
is a string specifying how superdiagonals and subdiagonals should be aligned, respectively. "RIGHT_LEFT"
aligns superdiagonals to the right (left-pads the row) and subdiagonals to the left (right-pads the row).
The number to fill the area outside the specified diagonal band. Default: 0.
align (str, optional): An optional string from: "RIGHT_LEFT"(default), "LEFT_RIGHT", "LEFT_LEFT",
"RIGHT_RIGHT". Align is a string specifying how superdiagonals and subdiagonals should be aligned,
respectively. "RIGHT_LEFT" aligns superdiagonals to the right (left-pads the row) and subdiagonals
to the left (right-pads the row).
Returns:
A Tensor. Has the same type as `x`.
@ -3097,15 +3099,16 @@ def matrix_diag_part(x, k=0, padding_value=0, align="RIGHT_LEFT"):
Args:
x (Tensor): The input Tensor with rank r, where r >= 2.
k (Union[int, Tensor], optional): A Tensor of type int32. Diagonal offset(s). Positive value means
superdiagonal, 0 refers to the main diagonal, and negative value means subdiagonals. k can be a single integer
(for a single diagonal) or a pair of integers specifying the low and high ends of a matrix band. k[0] must not
be larger than k[1]. The value of k has restructions, meaning value of k must be in
(-x.shape[-2], x.shape[-1]).
superdiagonal, 0 refers to the main diagonal, and negative value means subdiagonals. k can be
a single integer (for a single diagonal) or a pair of integers specifying the low and high ends
of a matrix band. k[0] must not be larger than k[1]. The value of k has restructions, meaning
value of k must be in (-x.shape[-2], x.shape[-1]).
padding_value (Union[int, float, Tensor], optional): A Tensor with only one value. Have the same dtype as x.
The number to fill the area outside the specified diagonal band. Default: 0.
align (str): An optional string from: "RIGHT_LEFT"(default), "LEFT_RIGHT", "LEFT_LEFT", "RIGHT_RIGHT". Align
is a string specifying how superdiagonals and subdiagonals should be aligned, respectively. "RIGHT_LEFT"
aligns superdiagonals to the right (left-pads the row) and subdiagonals to the left (right-pads the row).
The number to fill the area outside the specified diagonal band. Default: 0.
align (str, optional): An optional string from: "RIGHT_LEFT"(default), "LEFT_RIGHT", "LEFT_LEFT",
"RIGHT_RIGHT". Align is a string specifying how superdiagonals and subdiagonals should be aligned,
respectively. "RIGHT_LEFT" aligns superdiagonals to the right (left-pads the row) and subdiagonals
to the left (right-pads the row).
Returns:
A Tensor. Has the same type as `x`.
@ -4301,7 +4304,7 @@ def unsorted_segment_sum(input_x, segment_ids, num_segments):
Args:
input_x (Tensor): The shape is :math:`(x_1, x_2, ..., x_R)`.
segment_ids (Tensor): Set the shape as :math:`(x_1, x_2, ..., x_N)`, where 0 < N <= R.
num_segments (int): Set :math:`z` as num_segments.
num_segments (Union[int, Tensor], optional): Set :math:`z` as num_segments.
Returns:
Tensor, the shape is :math:`(z, x_{N+1}, ..., x_R)`.

View File

@ -4788,10 +4788,10 @@ def renorm(input_x, p, dim, maxnorm):
divided by the p-norm of the substensor and then multiplied by `maxnorm`.
Args:
input_x: A Tensor, types: float32 or float16.
input_x (Tensor): A Tensor, types: float32 or float16.
p (int): Power of norm calculation.
dim (int): The dimension that expected to get the slice-tensor.
maxnorm (float): Max norm.
maxnorm (float32): Max norm.
Returns:
Tensor, has the same dtype and shape as input_x.

View File

@ -1059,7 +1059,7 @@ def interpolate(x, roi=None, scales=None, sizes=None, coordinate_transformation_
must all be positive. Only one of `scales` and `sizes` can be specified. If `sizes` is specified, then set
`scales` to 'None' in this operator's input list. It is 1 int elements :math:`(new\_width,)` when `mode`
is "linear". It is 2 int elements :math:`(new\_height, new\_width)` when `mode` is "bilinear".
coordinate_transformation_mode (string): Default is 'align_corners'. Describes how to transform the coordinate
coordinate_transformation_mode (str): Default is 'align_corners'. Describes how to transform the coordinate
in the resized tensor to the coordinate in the original tensor. Other optional: 'half_pixel', 'asymmetric'.
For example, we want to resize the original tensor along axis x. Let's denote `new_i` as the i-th coordinate
of the resized tensor along axis x, `old_i` as the coordinate of the original tensor along axis x,

View File

@ -224,7 +224,7 @@ def csr_to_coo(tensor):
Only 2-D CSRTensor is supported for now.
Args:
tensor: A CSRTensor, must be 2-D.
tensor (CSRTensor): A CSRTensor, must be 2-D.
Returns:
2D COOTensor, the input tensor stored in COO format.
@ -266,7 +266,7 @@ def csr_to_dense(csr_tensor):
Only 2-D CSRTensor is supported for now.
Args:
csr_tensor: A CSRTensor, must be 2-D.
csr_tensor (CSRTensor): A CSRTensor, must be 2-D.
Returns:
Tensor.
@ -317,7 +317,7 @@ def dense_to_sparse_coo(tensor):
Only 2-D tensor is supported for now.
Args:
tensor: A dense tensor, must be 2-D.
tensor (Tensor): A dense tensor, must be 2-D.
Returns:
COOTensor, a sparse representation of the original dense tensor, containing the following parts.
@ -363,7 +363,7 @@ def dense_to_sparse_csr(tensor):
Only 2-D tensor is supported for now.
Args:
tensor: A dense tensor, must be 2-D.
tensor (Tensor): A dense tensor, must be 2-D.
Returns:
CSRTensor, a sparse representation of the original dense tensor, containing the following parts.