From 9ba8edf99db9d6e75804a9bf35dce92f4f16fe8c Mon Sep 17 00:00:00 2001 From: hw_hz Date: Tue, 28 Feb 2023 14:58:57 +0800 Subject: [PATCH] 1. docs for ResizeLinear1D 2. docs for DynamicBroadcastTo --- .../api_python/ops/mindspore.ops.ResizeLinear1D.rst | 5 +++-- .../python/mindspore/ops/operations/_inner_ops.py | 2 +- .../python/mindspore/ops/operations/image_ops.py | 11 ++++++----- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/api/api_python/ops/mindspore.ops.ResizeLinear1D.rst b/docs/api/api_python/ops/mindspore.ops.ResizeLinear1D.rst index ea6932cbeb4..c8efaf41903 100644 --- a/docs/api/api_python/ops/mindspore.ops.ResizeLinear1D.rst +++ b/docs/api/api_python/ops/mindspore.ops.ResizeLinear1D.rst @@ -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"。 diff --git a/mindspore/python/mindspore/ops/operations/_inner_ops.py b/mindspore/python/mindspore/ops/operations/_inner_ops.py index a33f6a037c7..d1e856154b0 100755 --- a/mindspore/python/mindspore/ops/operations/_inner_ops.py +++ b/mindspore/python/mindspore/ops/operations/_inner_ops.py @@ -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 diff --git a/mindspore/python/mindspore/ops/operations/image_ops.py b/mindspore/python/mindspore/ops/operations/image_ops.py index 862630a1dec..132613406d9 100644 --- a/mindspore/python/mindspore/ops/operations/image_ops.py +++ b/mindspore/python/mindspore/ops/operations/image_ops.py @@ -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.]]]