commit
8f42725575
|
@ -1,7 +1,7 @@
|
|||
mindspore.Tensor.reverse_sequence
|
||||
==================================
|
||||
|
||||
.. py:function:: mindspore.Tensor.reverse_sequce(seq_lengths, seq_dim=0, batch_dim=0)
|
||||
.. py:method:: mindspore.Tensor.reverse_sequce(seq_lengths, seq_dim=0, batch_dim=0)
|
||||
|
||||
对输入序列进行部分反转。
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ mindspore.data_sink
|
|||
- **steps** (int) - 总的运行次数。 `steps` 必须为正整数。
|
||||
- **sink_size** (int) - 控制每次下沉的数据执行次数。 `sink_size` 必须为正整数。默认值:1。
|
||||
- **jit_config** (JitConfig) - 编译时所使用的JitConfig配置项,详细可参考 :class:`mindspore.JitConfig` 。默认值:None,表示以PyNative模式运行。
|
||||
- **input_signature** (Tensor) - 用于表示输入参数的Tensor。Tensor的shape和dtype将作为函数的输入shape和dtype。默认值:None。
|
||||
- **input_signature** (Union[Tensor, List or Tuple of Tensors]) - 用于表示输入参数的Tensor。Tensor的shape和dtype将作为函数的输入shape和dtype。默认值:None。
|
||||
|
||||
返回:
|
||||
函数,该生成的函数会以数据下沉模式执行。
|
||||
|
|
|
@ -12,7 +12,7 @@ mindspore.nn.FractionalMaxPool3d
|
|||
输入输出的数据格式可以是"NCDHW"。其中,"N"是批次大小,"C"是通道数,"D"是特征深度,"H"是特征高度,"W"是特征宽度。
|
||||
|
||||
参数:
|
||||
- **kernel_size** (Union[float, tuple[int]]) - 指定池化核尺寸大小,如果为整数,则代表池化核的深、高和宽。如果为tuple,其值必须包含三个整数值分别表示池化核的深、高和宽。
|
||||
- **kernel_size** (Union[int, tuple[int]]) - 指定池化核尺寸大小,如果为整数,则代表池化核的深、高和宽。如果为tuple,其值必须包含三个整数值分别表示池化核的深、高和宽。
|
||||
- **output_size** (Union[int, tuple[int]]) - 目标输出大小。如果是整数,则表示输出目标的深、高和宽。如果是tuple,其值必须包含三个整数值分别表示目标输出的深、高和宽。默认值是 `None` 。
|
||||
- **output_ratio** (Union[float, tuple[float]]) - 目标输出shape与输入shape的比率。通过输入shape和 `output_ratio` 确定输出shape。支持数据类型:float16、float32、double,数值介于0到1之间。默认值是 `None` 。
|
||||
- **return_indices** (bool) - 如果为 `True` ,返回分数最大池化的最大值的的索引值。默认值是 `False` 。
|
||||
|
|
|
@ -11,11 +11,11 @@ mindspore.ops.broadcast_to
|
|||
|
||||
- 如果不相等,分以下三种情况:
|
||||
|
||||
- 情况一:如果目标shape该维的值为-1,则输出shape该维的值为对应输入shape该维的值。比如说输入shape为 :math:`(3, 3)` ,目标shape为 :math:`(-1, 3)` ,则输出shape为 :math:`(3, 3)` ;
|
||||
- 情况一:如果目标shape该维的值为-1,则输出shape该维的值为对应输入shape该维的值。比如说输入shape为 :math:`(3, 3)` ,目标shape为 :math:`(-1, 3)` ,则输出shape为 :math:`(3, 3)` ;
|
||||
|
||||
- 情况二:如果目标shape该维的值不为-1,但是输入shape该维的值为1,则输出shape该维的值为目标shape该维的值。比如说输入shape为 :math:`(1, 3)` ,目标shape为 :math:`(8, 3)` ,则输出shape为 :math:`(8, 3)` ;
|
||||
- 情况二:如果目标shape该维的值不为-1,但是输入shape该维的值为1,则输出shape该维的值为目标shape该维的值。比如说输入shape为 :math:`(1, 3)` ,目标shape为 :math:`(8, 3)` ,则输出shape为 :math:`(8, 3)` ;
|
||||
|
||||
- 情况三:如果两个shape对应值不满足以上情况则说明不支持由输入shape广播到目标shape。
|
||||
- 情况三:如果两个shape对应值不满足以上情况则说明不支持由输入shape广播到目标shape。
|
||||
|
||||
至此输出shape后面m维就确定好了,现在看一下前面 :math:`*` 维,有以下两种情况:
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
mindspore.ops.scalar_cast
|
||||
==========================
|
||||
|
||||
.. py:function:: mindspore.ops.mindspore.ops.scalar_cast(input_x, input_y)
|
||||
.. py:function:: mindspore.ops.scalar_cast(input_x, input_y)
|
||||
|
||||
将输入Scalar转换为其他类型。
|
||||
|
||||
|
|
|
@ -6451,11 +6451,14 @@ class Tensor(Tensor_):
|
|||
other (Union[Tensor, Number, bool]): The second input is a number or a bool when the first input is a tensor
|
||||
or a tensor whose data type is number or bool.
|
||||
rounding_mode (string, optional): Type of rounding applied to the result. Three types are defined as,
|
||||
None: Default behavior. Equivalent to true division in Python or `true_divide` in NumPy.
|
||||
`floor`: Rounds the results of the division down. Equivalent to floor division in Python
|
||||
or `floor_divide` in NumPy.
|
||||
`trunc`: Rounds the results of the division towards zero. Equivalent to C-style integer division.
|
||||
Default: None.
|
||||
|
||||
- None: Default behavior. Equivalent to true division in Python or `true_divide` in NumPy.
|
||||
|
||||
- floor: Rounds the results of the division down. Equivalent to floor division in Python
|
||||
or `floor_divide` in NumPy.
|
||||
|
||||
- trunc: Rounds the results of the division towards zero. Equivalent to C-style integer division.
|
||||
Default: None.
|
||||
|
||||
Returns:
|
||||
Tensor, the shape is the same as the one after broadcasting, and the data type is the one with higher
|
||||
|
|
|
@ -122,7 +122,7 @@ class MaxPool3d(Cell):
|
|||
the max values are generated.
|
||||
|
||||
- **output** (Tensor) - Maxpooling result, with shape :math:`(N_{out}, C_{out}, D_{out}, H_{out}, W_{out})` or
|
||||
:math:`(C_{out}, D_{out}, H_{out}, W_{out})`. It has the same data type as `x`.
|
||||
:math:`(C_{out}, D_{out}, H_{out}, W_{out})`. It has the same data type as `x`.
|
||||
- **argmax** (Tensor) - Index corresponding to the maximum value. Data type is int64.
|
||||
|
||||
Raises:
|
||||
|
@ -385,7 +385,7 @@ class AvgPool3d(Cell):
|
|||
|
||||
Inputs:
|
||||
- **x** (Tensor) - Tensor of shape :math:`(N, C, D_{in}, H_{in}, W_{in})` or
|
||||
:math:`(C, D_{in}, H_{in}, W_{in})`.
|
||||
:math:`(C, D_{in}, H_{in}, W_{in})`.
|
||||
Currently support float16 and float32 data type.
|
||||
|
||||
Outputs:
|
||||
|
@ -1111,7 +1111,7 @@ class FractionalMaxPool2d(Cell):
|
|||
`output_size` can be a tuple, or a single H for H x H.
|
||||
specifying the size (H, W) of the output tensor.
|
||||
Default: None.
|
||||
output_ratio (Union[float, tuple]): The target `output_ratio` is H x W.
|
||||
output_ratio (Union[float, tuple[float]]): The target `output_ratio` is H x W.
|
||||
`output_ratio` can be a tuple, or a single H for H x H.
|
||||
Specifying the size of the output tensor by using a ratio of the input size.
|
||||
Data type : float16, float32, double, and value is between (0, 1).
|
||||
|
@ -1234,14 +1234,14 @@ class FractionalMaxPool3d(Cell):
|
|||
D the feature depth, H is the feature height, and W is the feature width.
|
||||
|
||||
Args:
|
||||
kernel_size (Union[float, tuple]): The target `kernel_size` is D x H x W.
|
||||
kernel_size (Union[int, tuple[int]]): The target `kernel_size` is D x H x W.
|
||||
`kernel_size` can be a tuple, or a single K for K x K x K.
|
||||
specifying the window size (D, H, W) of the input tensor.
|
||||
output_size (Union[int, tuple]): The target `output_size` is D x H x W.
|
||||
output_size (Union[int, tuple[int]]): The target `output_size` is D x H x W.
|
||||
`output_size` can be a tuple, or a single H for H x H x H.
|
||||
Specifying the size (D, H, W) of the output tensor.
|
||||
Default: None.
|
||||
output_ratio (Union[float, tuple]): The target `output_ratio` is D x H x W.
|
||||
output_ratio (Union[float, tuple[float]]): The target `output_ratio` is D x H x W.
|
||||
`output_ratio` can be a tuple, or a single H for H x H x H.
|
||||
Specifying the size of the output tensor by using a ratio of the input size.
|
||||
Data type : float16, float32, double, and value is between (0, 1).
|
||||
|
|
|
@ -3503,12 +3503,12 @@ def broadcast_to(x, shape):
|
|||
|
||||
If the first :math:`*` dims of output shape does not have -1 in it, then fill the input
|
||||
shape with ones until their length are the same, and then refer to
|
||||
Case 2 mentioned above to calculate the output shape. With target shape :math:` (3, 1, 4, 1, 5, 9)`,
|
||||
Case 2 mentioned above to calculate the output shape. With target shape :math:`(3, 1, 4, 1, 5, 9)`,
|
||||
input shape :math:`(1, 5, 9)`, the filled input shape will be :math:`(1, 1, 1, 1, 5, 9)` and thus the
|
||||
output shape is :math:` (3, 1, 4, 1, 5, 9)`.
|
||||
output shape is :math:`(3, 1, 4, 1, 5, 9)`.
|
||||
|
||||
If the first :math:`*` dims of output shape have -1 in it, it implies this -1 is conrresponding to
|
||||
a non-existing dim so they're not broadcastable. With target shape :math:` (3, -1, 4, 1, 5, 9)`,
|
||||
a non-existing dim so they're not broadcastable. With target shape :math:`(3, -1, 4, 1, 5, 9)`,
|
||||
input shape :math:`(1, 5, 9)`, instead of operating the dim-filling process first, it raises errors directly.
|
||||
|
||||
Args:
|
||||
|
|
|
@ -622,11 +622,14 @@ def div(input, other, rounding_mode=None):
|
|||
y (Union[Tensor, Number, bool]): The second input is a number or
|
||||
a bool when the first input is a tensor or a tensor whose data type is number or bool.
|
||||
rounding_mode (str, optional): Type of rounding applied to the result. Three types are defined as,
|
||||
None: Default behavior. Equivalent to true division in Python or `true_divide` in NumPy.
|
||||
`floor`: Rounds the results of the division down. Equivalent to floor division in Python
|
||||
or `floor_divide` in NumPy.
|
||||
`trunc`: Rounds the results of the division towards zero. Equivalent to C-style integer division.
|
||||
Default: None.
|
||||
|
||||
- None: Default behavior. Equivalent to true division in Python or `true_divide` in NumPy.
|
||||
|
||||
- floor: Rounds the results of the division down. Equivalent to floor division in Python
|
||||
or `floor_divide` in NumPy.
|
||||
|
||||
- trunc: Rounds the results of the division towards zero. Equivalent to C-style integer division.
|
||||
Default: None.
|
||||
|
||||
Returns:
|
||||
Tensor, the shape is the same as the one after broadcasting,
|
||||
|
|
Loading…
Reference in New Issue