!49523 ResizeLinea1D文档修改
Merge pull request !49523 from haozhang/code_docs_resize_linear1d
This commit is contained in:
commit
9dff86b515
|
@ -10,8 +10,9 @@ mindspore.ops.ResizeLinear1D
|
||||||
使用通用resize功能请参考 :func:`mindspore.ops.interpolate`。
|
使用通用resize功能请参考 :func:`mindspore.ops.interpolate`。
|
||||||
|
|
||||||
.. warning::
|
.. warning::
|
||||||
实验特性,接口可能发生变化。
|
- 实验特性,接口可能发生变化。
|
||||||
目前,昇腾平台仅支持输入 `size` 为Tuple或List的场景。
|
- 目前,昇腾平台仅支持输入 `size` 为Tuple或List的场景。
|
||||||
|
- 同时,昇腾平台上未支持属性coordinate_transformation_mode为asymmetric的情景。
|
||||||
|
|
||||||
参数:
|
参数:
|
||||||
- **coordinate_transformation_mode** (str) - 指定进行坐标变换的方式,默认值是"align_corners",还可选"half_pixel"和"asymmetric"。
|
- **coordinate_transformation_mode** (str) - 指定进行坐标变换的方式,默认值是"align_corners",还可选"half_pixel"和"asymmetric"。
|
||||||
|
|
|
@ -1475,7 +1475,7 @@ class DynamicBroadcastTo(Primitive):
|
||||||
ValueError: if the target and input shapes are incompatible.
|
ValueError: if the target and input shapes are incompatible.
|
||||||
|
|
||||||
Supported Platforms:
|
Supported Platforms:
|
||||||
``Ascend``
|
``Ascend`` ``GPU`` ``CPU``
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@prim_attr_register
|
@prim_attr_register
|
||||||
|
|
|
@ -649,8 +649,9 @@ class ResizeLinear1D(Primitive):
|
||||||
For general resize, refer to :func:`mindspore.ops.interpolate` for more details.
|
For general resize, refer to :func:`mindspore.ops.interpolate` for more details.
|
||||||
|
|
||||||
.. warning::
|
.. warning::
|
||||||
This is an experimental feature and is subjected to change.
|
- This is an experimental feature and is subjected to change.
|
||||||
Currently, the Ascend platform only supports scenarios where the input `size` is Tuple or List.
|
- Currently, the Ascend platform only supports scenarios where the input `size` is Tuple or List.
|
||||||
|
- And the attr `coordinate_transformation_mode` should not be 'asymmetric' in Ascend platform.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
coordinate_transformation_mode (str): Default is 'align_corners'. Describes how to transform the coordinate
|
coordinate_transformation_mode (str): Default is 'align_corners'. Describes how to transform the coordinate
|
||||||
|
@ -672,13 +673,13 @@ class ResizeLinear1D(Primitive):
|
||||||
TypeError: If `coordinate_transformation_mode` is not in the support list.
|
TypeError: If `coordinate_transformation_mode` is not in the support list.
|
||||||
|
|
||||||
Supported Platforms:
|
Supported Platforms:
|
||||||
``GPU`` ``CPU`` ``Ascend``
|
``Ascend`` ``GPU`` ``CPU``
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
>>> input = Tensor([[[1, 2, 3], [4, 5, 6]]], mindspore.float32)
|
>>> x = Tensor([[[1, 2, 3], [4, 5, 6]]], mindspore.float32)
|
||||||
>>> size = Tensor([6], mindspore.int32)
|
>>> size = Tensor([6], mindspore.int32)
|
||||||
>>> resize_linear_1d = ops.ResizeLinear1D(coordinate_transformation_mode="align_corners")
|
>>> resize_linear_1d = ops.ResizeLinear1D(coordinate_transformation_mode="align_corners")
|
||||||
>>> output = resize_linear_1d(x=input, size=size)
|
>>> output = resize_linear_1d(x, size)
|
||||||
>>> print(output)
|
>>> print(output)
|
||||||
[[[1. 1.4 1.8 2.2 2.6 3.]
|
[[[1. 1.4 1.8 2.2 2.6 3.]
|
||||||
[4. 4.4 4.8 5.2 5.6 6.]]]
|
[4. 4.4 4.8 5.2 5.6 6.]]]
|
||||||
|
|
Loading…
Reference in New Issue