forked from mindspore-Ecosystem/mindspore
fix math format
This commit is contained in:
parent
eec34072c0
commit
18cd9d7577
|
@ -9,7 +9,7 @@ mindspore.ops.RandomCategorical
|
|||
- **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) - 要抽取的样本数。只允许使用常量值。
|
||||
- **seed** (int) - 随机种子。只允许使用常量值。默认值:0。
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ mindspore.ops.matrix_diag_part
|
|||
返回:
|
||||
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。
|
||||
|
|
|
@ -10,7 +10,7 @@ mindspore.ops.print_
|
|||
.. note::
|
||||
在PyNative模式下,请使用Python print函数。在Ascend平台上的Graph模式下,bool、int和float将被转换为Tensor进行打印,str保持不变。
|
||||
该方法用于代码调试。当同时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_的输入。支持多个输入,用','分隔。
|
|
@ -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) - 要抽取的样本数。只允许使用常量值。
|
||||
- **seed** (int) - 随机种子。只允许使用常量值。默认值:0
|
||||
- **dtype** (mindspore.dtype) - 输出的类型。它的值必须是 mindspore.int16、mindspore.int32 和 mindspore.int64 之一。默认值:mindspore.int64。
|
||||
|
||||
返回:
|
||||
Tensor,Shape为 :math:`(batch_size, num_samples)` 的输出Tensor。
|
||||
Tensor,Shape为 :math:`(batch\_size, num\_samples)` 的输出Tensor。
|
||||
|
||||
异常:
|
||||
- **TypeError** - 如果 `dtype` 不是以下之一:mindspore.int16、mindspore.int32、mindspore.int64。
|
||||
|
|
|
@ -10,7 +10,7 @@ mindspore.ops.slice
|
|||
.. note::
|
||||
`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。
|
||||
|
|
|
@ -4390,7 +4390,7 @@ class Tensor(Tensor_):
|
|||
mindspore.int32 and mindspore.int64. Default: mindspore.int64.
|
||||
|
||||
Returns:
|
||||
Tensor, the output Tensor with shape :math:`(batch_size, num_samples)`.
|
||||
Tensor, the output Tensor with shape :math:`(batch\_size, num\_samples)`.
|
||||
|
||||
Raises:
|
||||
TypeError: If `dtype` is not one of the following: mindspore.int16, mindspore.int32, mindspore.int64.
|
||||
|
|
|
@ -1053,7 +1053,7 @@ def select(cond, x, y):
|
|||
|
||||
|
||||
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`,
|
||||
|
@ -1064,7 +1064,7 @@ def slice(input_x, begin, size):
|
|||
`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.
|
||||
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:
|
||||
input_x (Tensor): The target tensor.
|
||||
|
@ -2999,10 +2999,10 @@ def matrix_diag_part(x, k=0, padding_value=0, align="RIGHT_LEFT"):
|
|||
Returns:
|
||||
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
|
||||
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`.
|
||||
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]`
|
||||
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`.
|
||||
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]`
|
||||
|
||||
Raises:
|
||||
TypeError: If `x` is not Tensor.
|
||||
|
|
|
@ -133,14 +133,14 @@ def random_categorical(logits, num_sample, seed=0, dtype=mstype.int64):
|
|||
Generates random samples from a given categorical distribution tensor.
|
||||
|
||||
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.
|
||||
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,
|
||||
mindspore.int32 and mindspore.int64. Default: mindspore.int64.
|
||||
|
||||
Returns:
|
||||
Tensor, The output Tensor with shape :math:`(batch_size, num_samples)`.
|
||||
Tensor, The output Tensor with shape :math:`(batch\_size, num\_samples)`.
|
||||
|
||||
Raises:
|
||||
TypeError: If `dtype` is not one of the following: mindspore.int16, mindspore.int32, mindspore.int64.
|
||||
|
|
|
@ -6842,7 +6842,7 @@ class TensorScatterElements(Primitive):
|
|||
|
||||
|
||||
class ExtractVolumePatches(Primitive):
|
||||
"""
|
||||
r"""
|
||||
Extract patches from input and put them in the "depth" output dimension. 3D extension of extract_image_patches.
|
||||
|
||||
Args:
|
||||
|
@ -6875,8 +6875,8 @@ class ExtractVolumePatches(Primitive):
|
|||
ValueError: If input_x's shape has zero.
|
||||
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 = "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.
|
||||
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.
|
||||
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.
|
||||
|
||||
|
|
Loading…
Reference in New Issue