fix math format

This commit is contained in:
luojianing 2022-09-05 17:10:22 +08:00
parent eec34072c0
commit 18cd9d7577
9 changed files with 18 additions and 18 deletions

View File

@ -9,7 +9,7 @@ mindspore.ops.RandomCategorical
- **dtype** (mindspore.dtype) - 输出的类型。它的值必须是 mindspore.int16、mindspore.int32 和 mindspore.int64 之一。默认值mindspore.int64。 - **dtype** (mindspore.dtype) - 输出的类型。它的值必须是 mindspore.int16、mindspore.int32 和 mindspore.int64 之一。默认值mindspore.int64。
输入: 输入:
- **logits** (Tensor) - 输入Tensor。Shape为 :math:`(batch_size, num_classes)` 的二维Tensor。 - **logits** (Tensor) - 输入Tensor。Shape为 :math:`(batch\_size, num\_classes)` 的二维Tensor。
- **num_sample** (int) - 要抽取的样本数。只允许使用常量值。 - **num_sample** (int) - 要抽取的样本数。只允许使用常量值。
- **seed** (int) - 随机种子。只允许使用常量值。默认值0。 - **seed** (int) - 随机种子。只允许使用常量值。默认值0。

View File

@ -15,7 +15,7 @@ mindspore.ops.matrix_diag_part
返回: 返回:
Tensor`x` 的类型相同。 Tensor`x` 的类型相同。
`x` 有r维 `(I J ... M N)` 。设 `max_diag_len` 为所有对角线长度中的最大值,则 :math:`max_diag_len = min(M + min(k[1], 0), N + min(-k[0], 0))`。 设 `num_diags` 为输出的维度数,则有 :math:`num_diags = k[1] - k[0] + 1`。如果 :math:`num_diags == 1`则输出Tensor的维度为r - 1分别为 :math:`[I, J, ..., L, max_diag_len]`。 否则输出Tensor的维度为r分别为 :math:`[I, J, ..., L, num_diags, max_diag_len]`。 `x` 有r维 `(I J ... M N)` 。设 `max_diag_len` 为所有对角线长度中的最大值,则 :math:`max\_diag\_len = min(M + min(k[1], 0), N + min(-k[0], 0))`。 设 `num_diags` 为输出的维度数,则有 :math:`num\_diags = k[1] - k[0] + 1`。如果 :math:`num\_diags == 1`则输出Tensor的维度为r - 1分别为 :math:`[I, J, ..., L, max\_diag\_len]`。 否则输出Tensor的维度为r分别为 :math:`[I, J, ..., L, num\_diags, max\_diag\_len]`。
异常: 异常:
- **TypeError** - `x` 不为Tensor。 - **TypeError** - `x` 不为Tensor。

View File

@ -10,7 +10,7 @@ mindspore.ops.print_
.. note:: .. note::
在PyNative模式下请使用Python print函数。在Ascend平台上的Graph模式下bool、int和float将被转换为Tensor进行打印str保持不变。 在PyNative模式下请使用Python print函数。在Ascend平台上的Graph模式下bool、int和float将被转换为Tensor进行打印str保持不变。
该方法用于代码调试。当同时print大量数据时为了保证主进程不受影响可能会丢失一些数据。如果需要记录完整数据推荐使用 `Summary` 功能,具体可查看 该方法用于代码调试。当同时print大量数据时为了保证主进程不受影响可能会丢失一些数据。如果需要记录完整数据推荐使用 `Summary` 功能,具体可查看
`Summary <https://www.mindspore.cn/mindinsight/docs/zh-CN/master/summary_record.html?highlight=summary#>`_ `Summary <https://www.mindspore.cn/mindinsight/docs/zh-CN/master/summary_record.html?highlight=summary#>`_
参数: 参数:
- **input_x** (Union[Tensor, bool, int, float, str]) - print_的输入。支持多个输入用''分隔。 - **input_x** (Union[Tensor, bool, int, float, str]) - print_的输入。支持多个输入用''分隔。

View File

@ -6,13 +6,13 @@ mindspore.ops.random_categorical
从分类分布中抽取样本。 从分类分布中抽取样本。
参数: 参数:
- **logits** (Tensor) - 输入Tensor。Shape为 :math:`(batch_size, num_classes)` 的二维Tensor。 - **logits** (Tensor) - 输入Tensor。Shape为 :math:`(batch\_size, num\_classes)` 的二维Tensor。
- **num_sample** (int) - 要抽取的样本数。只允许使用常量值。 - **num_sample** (int) - 要抽取的样本数。只允许使用常量值。
- **seed** (int) - 随机种子。只允许使用常量值。默认值0 - **seed** (int) - 随机种子。只允许使用常量值。默认值0
- **dtype** (mindspore.dtype) - 输出的类型。它的值必须是 mindspore.int16、mindspore.int32 和 mindspore.int64 之一。默认值mindspore.int64。 - **dtype** (mindspore.dtype) - 输出的类型。它的值必须是 mindspore.int16、mindspore.int32 和 mindspore.int64 之一。默认值mindspore.int64。
返回: 返回:
TensorShape为 :math:`(batch_size, num_samples)` 的输出Tensor。 TensorShape为 :math:`(batch\_size, num\_samples)` 的输出Tensor。
异常: 异常:
- **TypeError** - 如果 `dtype` 不是以下之一mindspore.int16、mindspore.int32、mindspore.int64。 - **TypeError** - 如果 `dtype` 不是以下之一mindspore.int16、mindspore.int32、mindspore.int64。

View File

@ -10,7 +10,7 @@ mindspore.ops.slice
.. note:: .. note::
`begin` 的起始值为0`size` 的起始值为1。 `begin` 的起始值为0`size` 的起始值为1。
如果 `size[i]` 为-1则维度i中的所有剩余元素都包含在切片中。这相当于 :math:`size[i] = input_x.shape(i) - begin[i]` 。 如果 `size[i]` 为-1则维度i中的所有剩余元素都包含在切片中。这相当于 :math:`size[i] = input\_x.shape(i) - begin[i]` 。
参数: 参数:
- **input_x** (Tensor) - Slice的输入任意维度的Tensor。 - **input_x** (Tensor) - Slice的输入任意维度的Tensor。

View File

@ -4390,7 +4390,7 @@ class Tensor(Tensor_):
mindspore.int32 and mindspore.int64. Default: mindspore.int64. mindspore.int32 and mindspore.int64. Default: mindspore.int64.
Returns: Returns:
Tensor, the output Tensor with shape :math:`(batch_size, num_samples)`. Tensor, the output Tensor with shape :math:`(batch\_size, num\_samples)`.
Raises: Raises:
TypeError: If `dtype` is not one of the following: mindspore.int16, mindspore.int32, mindspore.int64. TypeError: If `dtype` is not one of the following: mindspore.int16, mindspore.int32, mindspore.int64.

View File

@ -1053,7 +1053,7 @@ def select(cond, x, y):
def slice(input_x, begin, size): def slice(input_x, begin, size):
""" r"""
Slices a tensor in the specified shape. Slices a tensor in the specified shape.
Slice the tensor `input_x` in shape of `size` and starting at the location specified by `begin`, Slice the tensor `input_x` in shape of `size` and starting at the location specified by `begin`,
@ -1064,7 +1064,7 @@ def slice(input_x, begin, size):
`begin` is zero-based and `size` is one-based. `begin` is zero-based and `size` is one-based.
If `size[i]` is -1, all remaining elements in dimension i are included in the slice. If `size[i]` is -1, all remaining elements in dimension i are included in the slice.
This is equivalent to setting :math:`size[i] = input_x.shape(i) - begin[i]`. This is equivalent to setting :math:`size[i] = input\_x.shape(i) - begin[i]`.
Args: Args:
input_x (Tensor): The target tensor. input_x (Tensor): The target tensor.
@ -2999,10 +2999,10 @@ def matrix_diag_part(x, k=0, padding_value=0, align="RIGHT_LEFT"):
Returns: Returns:
A Tensor. Has the same type as `x`. A Tensor. Has the same type as `x`.
Assume `x` has r dimensions :math:`[I, J, ..., L, M, N]`. Let `max_diag_len` be the maximum length among all Assume `x` has r dimensions :math:`[I, J, ..., L, M, N]`. Let `max_diag_len` be the maximum length among all
diagonals to be extracted, :math:`max_diag_len = min(M + min(k[1], 0), N + min(-k[0], 0))` diagonals to be extracted, :math:`max\_diag\_len = min(M + min(k[1], 0), N + min(-k[0], 0))`
Let `num_diags` be the number of diagonals to extract, :math:`num_diags = k[1] - k[0] + 1`. Let `num_diags` be the number of diagonals to extract, :math:`num\_diags = k[1] - k[0] + 1`.
If :math:`num_diags == 1`, the output tensor is of rank r - 1 with shape :math:`[I, J, ..., L, max_diag_len]` If :math:`num\_diags == 1`, the output tensor is of rank r - 1 with shape :math:`[I, J, ..., L, max\_diag\_len]`
Otherwise, the output tensor has rank r with dimensions :math:`[I, J, ..., L, num_diags, max_diag_len]` Otherwise, the output tensor has rank r with dimensions :math:`[I, J, ..., L, num\_diags, max\_diag\_len]`
Raises: Raises:
TypeError: If `x` is not Tensor. TypeError: If `x` is not Tensor.

View File

@ -133,14 +133,14 @@ def random_categorical(logits, num_sample, seed=0, dtype=mstype.int64):
Generates random samples from a given categorical distribution tensor. Generates random samples from a given categorical distribution tensor.
Args: Args:
logits (Tensor): The input tensor. 2-D Tensor with shape :math:`(batch_size, num_classes)`. logits (Tensor): The input tensor. 2-D Tensor with shape :math:`(batch\_size, num\_classes)`.
num_sample (int): Number of sample to be drawn. Only constant values is allowed. num_sample (int): Number of sample to be drawn. Only constant values is allowed.
seed (int): Random seed. Only constant values is allowed. Default: 0. seed (int): Random seed. Only constant values is allowed. Default: 0.
dtype (mindspore.dtype): The type of output. Its value must be one of mindspore.int16, dtype (mindspore.dtype): The type of output. Its value must be one of mindspore.int16,
mindspore.int32 and mindspore.int64. Default: mindspore.int64. mindspore.int32 and mindspore.int64. Default: mindspore.int64.
Returns: Returns:
Tensor, The output Tensor with shape :math:`(batch_size, num_samples)`. Tensor, The output Tensor with shape :math:`(batch\_size, num\_samples)`.
Raises: Raises:
TypeError: If `dtype` is not one of the following: mindspore.int16, mindspore.int32, mindspore.int64. TypeError: If `dtype` is not one of the following: mindspore.int16, mindspore.int32, mindspore.int64.

View File

@ -6842,7 +6842,7 @@ class TensorScatterElements(Primitive):
class ExtractVolumePatches(Primitive): class ExtractVolumePatches(Primitive):
""" r"""
Extract patches from input and put them in the "depth" output dimension. 3D extension of extract_image_patches. Extract patches from input and put them in the "depth" output dimension. 3D extension of extract_image_patches.
Args: Args:
@ -6875,8 +6875,8 @@ class ExtractVolumePatches(Primitive):
ValueError: If input_x's shape has zero. ValueError: If input_x's shape has zero.
ValueError: If one of kernel_size or strides' first two numbers is not 1. ValueError: If one of kernel_size or strides' first two numbers is not 1.
ValueError: If padding = "VALID" and input - kernel_size is less than 0 in d, h or w dimension. ValueError: If padding = "VALID" and input - kernel_size is less than 0 in d, h or w dimension.
ValueError: If padding = "SAME" and :math:`padding_needed = ((input_x + strides - 1) / strides - 1) * ValueError: If padding = "SAME" and :math:`padding\_needed = ((input\_x + strides - 1) / strides - 1) *
strides + kernel_size - input` is less than 0 in d, h or w dimension. strides + kernel\_size - input` is less than 0 in d, h or w dimension.
ValueError: If x_h is not 1 or x_w is not 1 and x_w + padding_needed - k_w - s_w is less than 0. ValueError: If x_h is not 1 or x_w is not 1 and x_w + padding_needed - k_w - s_w is less than 0.
ValueError: If x_d * x_h * x_w is greater than 2048. ValueError: If x_d * x_h * x_w is greater than 2048.