forked from mindspore-Ecosystem/mindspore
!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`。
|
||||
|
||||
.. warning::
|
||||
实验特性,接口可能发生变化。
|
||||
目前,昇腾平台仅支持输入 `size` 为Tuple或List的场景。
|
||||
- 实验特性,接口可能发生变化。
|
||||
- 目前,昇腾平台仅支持输入 `size` 为Tuple或List的场景。
|
||||
- 同时,昇腾平台上未支持属性coordinate_transformation_mode为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.
|
||||
|
||||
Supported Platforms:
|
||||
``Ascend``
|
||||
``Ascend`` ``GPU`` ``CPU``
|
||||
"""
|
||||
|
||||
@prim_attr_register
|
||||
|
|
|
@ -649,8 +649,9 @@ class ResizeLinear1D(Primitive):
|
|||
For general resize, refer to :func:`mindspore.ops.interpolate` for more details.
|
||||
|
||||
.. warning::
|
||||
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.
|
||||
- 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.
|
||||
- And the attr `coordinate_transformation_mode` should not be 'asymmetric' in Ascend platform.
|
||||
|
||||
Args:
|
||||
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.
|
||||
|
||||
Supported Platforms:
|
||||
``GPU`` ``CPU`` ``Ascend``
|
||||
``Ascend`` ``GPU`` ``CPU``
|
||||
|
||||
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)
|
||||
>>> 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)
|
||||
[[[1. 1.4 1.8 2.2 2.6 3.]
|
||||
[4. 4.4 4.8 5.2 5.6 6.]]]
|
||||
|
|
Loading…
Reference in New Issue