From 25b6f474b95c24d36db30df7adae1ccdd3357e00 Mon Sep 17 00:00:00 2001 From: hedongdong Date: Thu, 12 Jan 2023 23:10:19 +0800 Subject: [PATCH] fix supported platforms --- .../api_python/mindspore.ops.primitive.rst | 1 - .../api_python_en/mindspore.ops.primitive.rst | 1 - .../mindspore/ops/operations/_grad_ops.py | 34 ++++++------ .../mindspore/ops/operations/array_ops.py | 42 +++++++-------- .../mindspore/ops/operations/image_ops.py | 22 ++++---- .../mindspore/ops/operations/linalg_ops.py | 2 +- .../mindspore/ops/operations/math_ops.py | 52 +++++++++---------- .../python/mindspore/ops/operations/nn_ops.py | 36 ++++++------- .../mindspore/ops/operations/other_ops.py | 2 +- .../mindspore/ops/operations/random_ops.py | 8 +-- .../mindspore/ops/operations/sparse_ops.py | 32 ++++++------ .../mindspore/ops/operations/spectral_ops.py | 2 +- 12 files changed, 116 insertions(+), 118 deletions(-) diff --git a/docs/api/api_python/mindspore.ops.primitive.rst b/docs/api/api_python/mindspore.ops.primitive.rst index 37b62f6035c..1287a00b4b5 100644 --- a/docs/api/api_python/mindspore.ops.primitive.rst +++ b/docs/api/api_python/mindspore.ops.primitive.rst @@ -222,7 +222,6 @@ MindSpore中 `mindspore.ops.primitive` 接口与上一版本相比,新增、 mindspore.ops.IOU mindspore.ops.L2Normalize mindspore.ops.NMSWithMask - mindspore.ops.NonMaxSuppressionV3 mindspore.ops.NonMaxSuppressionWithOverlaps mindspore.ops.PSROIPooling mindspore.ops.RGBToHSV diff --git a/docs/api/api_python_en/mindspore.ops.primitive.rst b/docs/api/api_python_en/mindspore.ops.primitive.rst index c8d5a5f68da..a5d4708bc3c 100644 --- a/docs/api/api_python_en/mindspore.ops.primitive.rst +++ b/docs/api/api_python_en/mindspore.ops.primitive.rst @@ -221,7 +221,6 @@ Image Processing mindspore.ops.IOU mindspore.ops.L2Normalize mindspore.ops.NMSWithMask - mindspore.ops.NonMaxSuppressionV3 mindspore.ops.NonMaxSuppressionWithOverlaps mindspore.ops.PSROIPooling mindspore.ops.RGBToHSV diff --git a/mindspore/python/mindspore/ops/operations/_grad_ops.py b/mindspore/python/mindspore/ops/operations/_grad_ops.py index 26d9b29e0ba..02b024434c8 100644 --- a/mindspore/python/mindspore/ops/operations/_grad_ops.py +++ b/mindspore/python/mindspore/ops/operations/_grad_ops.py @@ -1048,7 +1048,7 @@ class MaxPoolGradGrad(_PoolGrad): ValueError: If the shapes of `origin_input` and `grad` are not equal. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` """ @prim_attr_register @@ -1291,7 +1291,7 @@ class MaxPoolGradGradWithArgmax(_PoolGrad): ValueError: If the shapes of `x` and `grad` are not equal. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` """ @prim_attr_register @@ -1409,7 +1409,7 @@ class LayerNormGradGrad(Primitive): ValueError: If gamma, d_dg, d_db don't have the same shape. Supported Platforms: - ``Ascend`` ``CPU`` ``GPU`` + ``GPU`` ``CPU`` """ @prim_attr_register @@ -1942,7 +1942,7 @@ class UpsampleNearest3DGrad(Primitive): ValueError: If shape of `x` is not 5D. Supported Platforms: - ``GPU`` ``Ascend`` ``CPU`` + ``Ascend`` ``GPU`` ``CPU`` """ @prim_attr_register def __init__(self, input_size, output_size=None, scales=None): @@ -2466,7 +2466,7 @@ class MvlgammaGrad(Primitive): ValueError: If all elements of `x` are not greater than (p-1)/2. Supported Platforms: - ``Ascend`` ``CPU`` + ``CPU`` """ @prim_attr_register @@ -2554,7 +2554,7 @@ class PdistGrad(Primitive): ValueError: If dimension of `x` is not 2. Supported Platforms: - ``Ascend`` ``CPU`` ``GPU`` + ``GPU`` ``CPU`` """ @prim_attr_register @@ -2686,7 +2686,7 @@ class Dilation2DBackpropInput(Primitive): ValueError: If `data_format` is not the str of 'NCHW'. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: (pad_mode="SAME", data_format="NCHW") @@ -2803,7 +2803,7 @@ class Dilation2DBackpropFilter(Primitive): Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: (pad_mode="SAME", data_format="NCHW") @@ -2943,7 +2943,7 @@ class MultiMarginLossGrad(Primitive): ValueError: If rank of `x` is not 2 or rank of 'target' is not 1. Supported Platforms: - ``Ascend`` ``CPU`` + ``CPU`` """ @prim_attr_register @@ -3003,7 +3003,7 @@ class UpsampleTrilinear3DGrad(Primitive): ValueError: If elements number of `input_size` is not 5. Supported Platforms: - ``Ascend`` ``CPU`` ``GPU`` + ``GPU`` ``CPU`` """ @prim_attr_register def __init__(self, input_size, output_size=None, scales=None, align_corners=False): @@ -3071,7 +3071,7 @@ class GridSampler3DGrad(Primitive): ValueError: If the shape of `grad` is inconsistent with the shape of the output result of forward calculation. Supported Platforms: - ``CPU````GPU`` + ``Ascend`` ``GPU`` ``CPU`` """ @prim_attr_register @@ -3280,7 +3280,7 @@ class IgammaGradA(Primitive): ValueError: If `a` could not be broadcast to a tensor with shape of `x`. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> a = Tensor(np.array([2.0, 4.0, 6.0, 8.0]).astype(np.float32)) @@ -3390,7 +3390,7 @@ class MedianGrad(Primitive): ValueError: If shape of `y_grad` is not the same as `y`. Supported Platforms: - ``Ascend`` ``CPU`` + ``CPU`` """ @prim_attr_register @@ -3479,7 +3479,7 @@ class SparseSegmentSqrtNGrad(Primitive): ValueError: If `indices` is bigger than or equal to `output_dim0`. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` """ @prim_attr_register @@ -3525,7 +3525,7 @@ class GridSampler2DGrad(Primitive): ValueError: If the shape of `grad` is inconsistent with the shape of the output result of forward calculation. Supported Platforms: - ``CPU````GPU`` + ``Ascend`` ``GPU`` ``CPU`` """ @prim_attr_register @@ -3566,7 +3566,7 @@ class ResizeBicubicGrad(Primitive): ValueError: If `size` dim is not 4. Supported Platforms: - ``Ascend`` ``CPU`` ``GPU`` + ``GPU`` ``CPU`` """ @prim_attr_register def __init__(self, align_corners=False, half_pixel_centers=False): @@ -3690,7 +3690,7 @@ class FractionalMaxPoolGradWithFixedKsize(Primitive): ValueError: If the second dimension size of `origin_input` and `out_backprop` is not equal. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` """ @prim_attr_register diff --git a/mindspore/python/mindspore/ops/operations/array_ops.py b/mindspore/python/mindspore/ops/operations/array_ops.py index b890ae52a61..2d2d4da4699 100755 --- a/mindspore/python/mindspore/ops/operations/array_ops.py +++ b/mindspore/python/mindspore/ops/operations/array_ops.py @@ -97,7 +97,7 @@ class UnravelIndex(Primitive): ValueError: If `indices` contains negative elements. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> indices = Tensor(np.array([2, 5]), mindspore.int32) @@ -2629,7 +2629,7 @@ class Stack(PrimitiveWithInfer): Refer to :func:`mindspore.ops.stack` for more details. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> data1 = Tensor(np.array([0, 1]).astype(np.float32)) @@ -3584,7 +3584,7 @@ class Mvlgamma(Primitive): Refer to :func:`mindspore.ops.mvlgamma` for more details. Supported Platforms: - ``Ascend`` ``CPU`` ``GPU`` + ``GPU`` ``CPU`` Examples: >>> x = Tensor(np.array([[3, 4, 5], [4, 2, 6]]), mindspore.float32) @@ -3800,7 +3800,7 @@ class ResizeNearestNeighborV2(Primitive): ValueError: If attr `half_pixel_centers` and `align_corners` are True at the same time. Supported Platforms: - ``Ascend`` ``CPU`` + ``CPU`` Examples: >>> input_tensor = Tensor(np.ones((1, 4, 4, 1)), mstype.float32) @@ -4360,7 +4360,7 @@ class Triu(Primitive): ValueError: If length of shape of x is less than 1. Supported Platforms: - ``GPU`` ``CPU`` + ``Ascend`` ``GPU`` ``CPU`` Examples: >>> x = Tensor(np.array([[ 1, 2, 3, 4], @@ -5857,7 +5857,7 @@ class Identity(Primitive): TypeError: If `x` is not a Tensor. Supported Platforms: - ``Ascend`` ``CPU`` ``GPU`` + ``Ascend`` ``GPU`` ``CPU`` Examples: >>> x = Tensor(np.array([1, 2, 3, 4]), mindspore.int64) @@ -5890,7 +5890,7 @@ class IdentityN(Primitive): TypeError: If input `x` type is not RealNumber. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> x = [Tensor(np.array([1, 2, 3, 4]), mstype.int64), Tensor(np.array([4, 3, 1, 1]), mstype.int64)] @@ -6542,7 +6542,7 @@ class ListDiff(Primitive): TypeError: If attr `out_idx` not in [mindspore.dtype.int32, mindspore.dtype.int64]. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> x = Tensor(np.arange(1, 7, 1), dtype=mindspore.dtype.int32) # [1, 2, 3, 4, 5, 6] @@ -6801,7 +6801,7 @@ class ScatterAddWithAxis(Primitive): ValueError: If the shape of `indices` is not equal to the shape of `updates`. Supported Platforms: - ``Ascend`` ``CPU`` + ``CPU`` Examples: >>> op = ops.ScatterAddWithAxis(0) @@ -7133,7 +7133,7 @@ class LogSpace(Primitive): ValueError: If `base` is not a non-negative integer. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> logspace = ops.LogSpace(steps = 10, base = 10, dtype=mindspore.float32) @@ -7208,7 +7208,7 @@ class Tril(Primitive): ValueError: If the rank of `x` is less than 2. Supported Platforms: - ``GPU`` ``CPU`` + ``Ascend`` ``GPU`` ``CPU`` Examples: >>> x = Tensor(np.array([[ 1, 2, 3, 4], @@ -7261,7 +7261,7 @@ class IndexFill(Primitive): Refer to :func:`mindspore.ops.index_fill` for more details. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> index_fill = ops.IndexFill() @@ -7311,7 +7311,7 @@ class SegmentMax(Primitive): ValueError: If the values of `segment_ids` are not sorted in ascending order. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> x = Tensor([[1, 2, 3], [4, 5, 6], [7, 8, 9]], mstype.float64) @@ -7361,7 +7361,7 @@ class SegmentMin(Primitive): ValueError: If the values of `segment_ids` are not sorted in ascending order. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> x = Tensor([[1, 2, 3], [4, 5, 6], [7, 8, 9]], mstype.float64) @@ -7415,7 +7415,7 @@ class SegmentSum(Primitive): ValueError: If the values of `segment_ids` are not sorted in ascending order. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> x = Tensor([[1, 2, 3], [4, 5, 6], [7, 8, 9]], mstype.float64) @@ -7465,7 +7465,7 @@ class LeftShift(Primitive): ValueError: If `x1` and `x2` could not be broadcast. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> left_shift = ops.LeftShift() @@ -7505,7 +7505,7 @@ class FillDiagonal(Primitive): ValueError: If the size of each dimension is not equal, when the dimension is greater than 2. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> x = Tensor(np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]).astype(np.float32)) @@ -7592,7 +7592,7 @@ class HammingWindow(Primitive): ValueError: If data of `length` is negative. Supported Platforms: - ``Ascend`` ``CPU`` ``GPU`` + ``GPU`` ``CPU`` Examples: >>> # case 1: periodic=True. @@ -7634,7 +7634,7 @@ class AffineGrid(Primitive): Refer to :func:`mindspore.ops.affine_grid` for more details. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> affinegrid = ops.AffineGrid(align_corners=False) @@ -7691,7 +7691,7 @@ class SegmentMean(Primitive): ValueError: If the values of `segment_ids` are not sorted in ascending order. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> x = Tensor([[1, 2, 3], [1, 2, 3], [7, 8, 9]], mstype.float64) @@ -7745,7 +7745,7 @@ class SegmentProd(Primitive): ValueError: If the values of `segment_ids` are not sorted in ascending order. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> x = Tensor([[1, 2, 3], [4, 5, 6], [7, 8, 9]], mstype.float64) diff --git a/mindspore/python/mindspore/ops/operations/image_ops.py b/mindspore/python/mindspore/ops/operations/image_ops.py index 783bfebb0da..042ec61bf6c 100644 --- a/mindspore/python/mindspore/ops/operations/image_ops.py +++ b/mindspore/python/mindspore/ops/operations/image_ops.py @@ -48,7 +48,7 @@ class AdjustSaturation(Primitive): ValueError: If the last dimension of the 'image' is not 3. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> x = Tensor([[[1.0, 2.0, 3.0], @@ -96,7 +96,7 @@ class AdjustContrastv2(Primitive): ValueError: If the dimension of the 'images' is less than 3, or the last dimension of the 'images' is not 3. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> images = Tensor([[[1.0, 2.0, 3.0], @@ -145,7 +145,7 @@ class AdjustHue(Primitive): ValueError: If the dimension of `image` is less than 3. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> class AdjustHue(nn.Cell): @@ -225,7 +225,7 @@ class ExtractGlimpse(Primitive): ValueError: If the input is not Tensor. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> x = Tensor([[[[0.0], [1.0], [2.0]], [[3.0], [4.0], [5.0]], [[6.0], [7.0], [8.0]]]], dtype=mindspore.float32) @@ -460,7 +460,7 @@ class NonMaxSuppressionWithOverlaps(Primitive): ValueError: If the shape of `scores` is not equal to the shape of the dim0 or dim1 of `overlaps`. Supported Platforms: - ``Ascend`` ``CPU`` ``GPU`` + ``GPU`` ``CPU`` Examples: >>> overlaps = Tensor(np.array([[0.6964692, 0.28613934, 0.22685145, 0.5513148], @@ -569,7 +569,7 @@ class CropAndResizeGradBoxes(Primitive): ValueError: If the length of `box_index` is not equal to num_boxes. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> crop_and_resize_grad_boxes = ops.CropAndResizeGradBoxes(method = "bilinear") @@ -616,7 +616,7 @@ class RGBToHSV(Primitive): ValueError: If the last value of shape of `images` is not 3. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> images = np.array([0.25, 0.5, 0.5]).astype(np.float32).reshape([1, 1, 1, 3]) @@ -781,7 +781,7 @@ class ResizeBicubic(Primitive): ValueError: If `align_corners` and `half_pixel_centers` value are both True. Supported Platforms: - ``Ascend`` ``CPU`` ``GPU`` + ``GPU`` ``CPU`` Examples: >>> class NetResizeBicubic(nn.Cell): @@ -884,7 +884,7 @@ class ResizeArea(Primitive): ValueError: If any value of `size` is not positive. Supported Platforms: - ``Ascend`` ``CPU`` ``GPU`` + ``GPU`` ``CPU`` Examples: >>> images = Tensor([[[[2], [4], [6], [8]], [[10], [12], [14], [16]]]], mindspore.float16) @@ -956,7 +956,7 @@ class CropAndResizeGradImage(Primitive): ValueError: If the value of image_height or image_width of `image_size` is not positive. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> crop_and_resize_grad_image = ops.CropAndResizeGradImage(T = mindspore.float32, method = "bilinear") @@ -1044,7 +1044,7 @@ class ScaleAndTranslate(Primitive): ValueError: If the shape of `translation` is not :math:`(2,)`. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> op = ops.ScaleAndTranslate() diff --git a/mindspore/python/mindspore/ops/operations/linalg_ops.py b/mindspore/python/mindspore/ops/operations/linalg_ops.py index 3d48e6600cf..7c094522928 100644 --- a/mindspore/python/mindspore/ops/operations/linalg_ops.py +++ b/mindspore/python/mindspore/ops/operations/linalg_ops.py @@ -46,7 +46,7 @@ class Geqrf(Primitive): ValueError: If `x` dimension is less than 2 Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> input_x = Tensor(np.array([[-2.0, -1.0], [1.0, 2.0]]).astype(np.float32)) diff --git a/mindspore/python/mindspore/ops/operations/math_ops.py b/mindspore/python/mindspore/ops/operations/math_ops.py index 1a5a580f25b..5f2f856b20a 100644 --- a/mindspore/python/mindspore/ops/operations/math_ops.py +++ b/mindspore/python/mindspore/ops/operations/math_ops.py @@ -365,7 +365,7 @@ class AddV2(Primitive): Supported Platforms: - ``Ascend`` ``CPU`` + ``CPU`` Examples: >>> from mindspore.ops.operations.math_ops import AddV2 @@ -1346,7 +1346,7 @@ class Lcm(Primitive): ValueError: If shape of two inputs are not broadcastable. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> x1 = Tensor(np.array([7, 8, 9])) @@ -2712,7 +2712,7 @@ class Histogram(Primitive): ValueError: If attr `bins` <= 0. Supported Platforms: - ``Ascend`` ``CPU`` + ``CPU`` Examples: >>> x = Tensor([1., 2, 1]) @@ -2847,7 +2847,7 @@ class Hypot(Primitive): ValueError: If shape of two inputs are not broadcastable. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> x1 = Tensor(np.array([3., 5., 7.])) @@ -2891,7 +2891,7 @@ class Heaviside(Primitive): ValueError: If shape of two inputs are not broadcastable. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> x = Tensor(np.array([-1.5, 0., 2.])) @@ -3719,7 +3719,7 @@ class Sinc(Primitive): TypeError: If `x` is not a Tensor. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> import mindspore @@ -4039,7 +4039,7 @@ class Gcd(Primitive): ValueError: If shape of two inputs are not broadcastable. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> x1 = Tensor(np.array([7, 8, 9])) @@ -4709,7 +4709,7 @@ class Sign(Primitive): TypeError: If `x` is not a Tensor. Supported Platforms: - ``Ascend`` ``CPU`` ``GPU`` + ``Ascend`` ``GPU`` ``CPU`` Examples: >>> x = Tensor(np.array([[2.0, 0.0, -1.0]]), mindspore.float32) @@ -4754,7 +4754,7 @@ class Tan(Primitive): Refer to :func:`mindspore.ops.tan` for more details. Supported Platforms: - ``Ascend`` ``CPU`` ``GPU`` + ``Ascend`` ``GPU`` ``CPU`` Examples: >>> tan = ops.Tan() @@ -5588,7 +5588,7 @@ class LogMatrixDeterminant(Primitive): Refer to :func:`mindspore.ops.log_matrix_determinant` for more details. Supported Platforms: - ``GPU`` ``CPU`` + ``Ascend`` ``GPU`` ``CPU`` Examples: >>> input_x = Tensor(np.array([[[-4.5, -1.5], [7.0, 6.0]], [[2.5, 0.5], [3.0, 9.0]]]), mindspore.float32) @@ -5805,7 +5805,7 @@ class ComplexAbs(Primitive): TypeError: If the input type is not complex64 or complex128. Supported Platforms: - ``Ascend`` ``CPU`` ``GPU`` + ``GPU`` ``CPU`` Examples: >>> x = Tensor(np.asarray(np.complex(3+4j)), mindspore.complex64) @@ -5868,7 +5868,7 @@ class Complex(Primitive): TypeError: If the dtypes of two inputs are not same. Supported Platforms: - ``Ascend`` ``CPU`` ``GPU`` + ``GPU`` ``CPU`` Examples: >>> real = Tensor(np.array([1]), mindspore.float32) @@ -5933,7 +5933,7 @@ class Angle(Primitive): TypeError: If the dtype of input is not one of: complex64, complex128. Supported Platforms: - ``Ascend`` ``CPU`` + ``CPU`` Examples: >>> input = Tensor([-1.5 + 7.8j, 3 + 5.75j], mindspore.complex64) @@ -6013,7 +6013,7 @@ class TridiagonalMatMul(Primitive): are not same. Supported Platforms: - ``Ascend`` ``CPU`` + ``CPU`` Examples: >>> tridiagonalmatmul = ops.TridiagonalMatMul() @@ -6071,7 +6071,7 @@ class Igamma(Primitive): ValueError: If `a` could not be broadcast to a tensor with shape of `x`. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> a = Tensor(np.array([2.0, 4.0, 6.0, 8.0]).astype(np.float32)) @@ -6119,7 +6119,7 @@ class Igammac(Primitive): ValueError: If `a` could not be broadcast to a tensor with shape of `x`. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> a = Tensor(np.array([2.0, 4.0, 6.0, 8.0]).astype(np.float32)) @@ -6177,7 +6177,7 @@ class MatrixExp(Primitive): Refer to :func:`mindspore.ops.matrix_exp` for more details. Supported Platforms: - ``Ascend`` ``CPU`` + ``CPU`` Examples: >>> matrix_exp = ops.MatrixExp() @@ -6327,7 +6327,7 @@ class LuSolve(Primitive): ValueError: If `x` dimension less than 2, `lu_data` dimension less than 2 or `lu_pivots` dimension less than 1. Supported Platforms: - ``Ascend`` ``CPU`` ``GPU`` + ``GPU`` ``CPU`` Examples: >>> x = Tensor(np.array([[1], [3], [3]]), mindspore.float32) @@ -6382,7 +6382,7 @@ class LuUnpack(Primitive): RuntimeError: On the Ascend platform, if the value of `LU_pivots` are out of range[1, LU_data.shape[-2]). Supported Platforms: - ``Ascend`` ``CPU`` + ``CPU`` Examples: >>> LU_data = Tensor(np.array([[[-0.3806, -0.4872, 0.5536], @@ -6628,7 +6628,7 @@ class RaggedRange(Primitive): ValueError: If the shape of `starts`, `limits` and `deltas` are not same. Supported Platforms: - ``Ascend`` ``CPU`` + ``CPU`` Examples: >>> raggedrange = ops.RaggedRange(Tsplits=mstype.int64) @@ -6670,7 +6670,7 @@ class Trace(Primitive): ValueError: If the dimension of `x` is not equal to 2. Supported Platforms: - ``Ascend`` ``CPU`` + ``CPU`` Examples: >>> x = Tensor(np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]), mindspore.float32) @@ -6803,7 +6803,7 @@ class Zeta(Primitive): ValueError: If shape of `x` is not same as the `q`. Supported Platforms: - ``Ascend`` ``CPU`` ``GPU`` + ``Ascend`` ``GPU`` ``CPU`` Examples: >>> x = Tensor(np.array([10.]), mindspore.float32) @@ -6941,7 +6941,7 @@ class Cholesky(Primitive): Refer to :func:`mindspore.ops.cholesky` for more details. Supported Platforms: - ``Ascend`` ``CPU`` + ``CPU`` Examples: >>> input_x = Tensor(np.array([[1.0, 1.0], [1.0, 2.0]]), mindspore.float32) @@ -7044,7 +7044,7 @@ class CholeskySolve(Primitive): ValueError: If `x2` is not 2D or 3D square matrices. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> x1 = Tensor(np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]), mindspore.float32) @@ -7248,7 +7248,7 @@ class NextAfter(Primitive): ValueError: If `x1`'s shape is not the same as `x2`. Supported Platforms: - ``Ascend`` ``CPU`` ``GPU`` + ``GPU`` ``CPU`` Examples: >>> nextafter = ops.NextAfter() @@ -7470,7 +7470,7 @@ class Orgqr(Primitive): Refer to :func:`mindspore.ops.orgqr` for more details. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> x = Tensor(np.array([[-114.6, 10.9, 1.1], [-0.304, 38.07, 69.38], [-0.45, -0.17, 62.]]), mindspore.float32) diff --git a/mindspore/python/mindspore/ops/operations/nn_ops.py b/mindspore/python/mindspore/ops/operations/nn_ops.py index 0ec2bb59eae..1b885c612da 100644 --- a/mindspore/python/mindspore/ops/operations/nn_ops.py +++ b/mindspore/python/mindspore/ops/operations/nn_ops.py @@ -908,7 +908,7 @@ class HSigmoid(Primitive): TypeError: If `input_x` is not a Tensor. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> hsigmoid = ops.HSigmoid() @@ -1421,7 +1421,7 @@ class DataFormatVecPermute(Primitive): ValueError: If input_x shape is not (4, ) or (4, 2). Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> class Net(nn.Cell): @@ -3017,7 +3017,7 @@ class MultiMarginLoss(Primitive): Refer to :func:`mindspore.ops.multi_margin_loss` for more details. Supported Platforms: - ``Ascend`` ``CPU`` + ``CPU`` Examples: >>> x = Tensor(np.ones(shape=[3, 3]), mindspore.float32) @@ -3780,7 +3780,7 @@ class UpsampleTrilinear3D(Primitive): ValueError: If size of `output_size` is not equal 3 when `output_size` is specified. Supported Platforms: - ``Ascend`` ``CPU`` ``GPU`` + ``GPU`` ``CPU`` Examples: >>> ops = ops.UpsampleTrilinear3D(output_size=[4, 64, 48]) @@ -4409,7 +4409,7 @@ class PadV3(Primitive): ValueError: After padding, output's shape number is not greater than 0. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> # case1: mode="reflect", paddings_contiguous=True @@ -4492,7 +4492,7 @@ class MirrorPad(Primitive): ValueError: If paddings.size is not equal to 2 * rank of input_x. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> from mindspore import Tensor, nn, ops @@ -8333,7 +8333,7 @@ class Dilation2D(Primitive): ValueError: If `data_format` is not the str of 'NCHW'. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> x = Tensor(np.ones([10, 5, 32, 32]), mindspore.float16) @@ -8751,7 +8751,7 @@ class SparseApplyCenteredRMSProp(Primitive): ValueError: If shape of `grad` is not same as shape of `var` except first dimension. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> import numpy as np @@ -9112,7 +9112,7 @@ class FractionalMaxPool(Primitive): ValueError: If the first and last element of `pooling_ratio` is not equal to 1.0. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> x = np.array([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]).reshape([1,4,4,1]).astype(np.int64) @@ -9198,7 +9198,7 @@ class FractionalMaxPool3DWithFixedKsize(Primitive): ValueError: If the third dimension size of `random_samples` is not 3. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> x = Tensor(np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]) @@ -9289,7 +9289,7 @@ class FractionalAvgPool(Primitive): ValueError: If the first and last element of `pooling_ratio` is not equal to 1.0. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> x = np.array([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]).reshape([1,4,4,1]).astype(np.int64) @@ -9345,7 +9345,7 @@ class NthElement(Primitive): ValueError**: If n is out of :math:`[0, input.shape[-1])`. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> input = Tensor(np.array([[1,2,3],[4,5,6]]) , mstype.int8) @@ -9517,7 +9517,7 @@ class TripletMarginLoss(Primitive): ValueError: If `reduction` is not one of 'none', 'mean', 'sum'. Supported Platforms: - ``Ascend`` ``CPU`` ``GPU`` + ``GPU`` ``CPU`` Examples: >>> loss = ops.TripletMarginLoss() @@ -9748,7 +9748,7 @@ class UpsampleNearest3D(Primitive): ValueError: If size of `output_size` is not equal 3 when `output_size` is specified. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> x = Tensor(np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]) @@ -9849,7 +9849,7 @@ class SparseApplyAdagradDA(Primitive): conversion of Parameter is not supported. Supported Platforms: - ``Ascend`` ``CPU`` + ``CPU`` Examples: >>> import numpy as np @@ -9946,7 +9946,7 @@ class SparseApplyMomentum(Primitive): is not supported. Supported Platforms: - ``Ascend`` ``CPU`` + ``CPU`` Examples: >>> import mindspore.ops.operations.nn_ops as nn_ops @@ -10030,7 +10030,7 @@ class SparseApplyProximalGradientDescent(Primitive): is not supported. Supported Platforms: - ``Ascend`` ``CPU`` + ``CPU`` Examples: >>> import mindspore.ops.operations.nn_ops as nn_ops @@ -10109,7 +10109,7 @@ class NuclearNorm(Primitive): x_rank is the dimension of Tensor `x`. Supported Platforms: - ``Ascend`` ``CPU`` + ``CPU`` Examples: >>> input_x = Tensor(np.array([[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], diff --git a/mindspore/python/mindspore/ops/operations/other_ops.py b/mindspore/python/mindspore/ops/operations/other_ops.py index c006108133b..c305b7e5556 100644 --- a/mindspore/python/mindspore/ops/operations/other_ops.py +++ b/mindspore/python/mindspore/ops/operations/other_ops.py @@ -287,7 +287,7 @@ class SampleDistortedBoundingBoxV2(Primitive): RuntimeError: If the value of `min_object_covered` is out of range [0.0, 1.0]. Supported Platforms: - ``Ascend`` ``CPU`` + ``CPU`` Examples: >>> image_size = Tensor([640, 480, 3], mindspore.int32) diff --git a/mindspore/python/mindspore/ops/operations/random_ops.py b/mindspore/python/mindspore/ops/operations/random_ops.py index 8740c31239a..ab01fc4b7d6 100755 --- a/mindspore/python/mindspore/ops/operations/random_ops.py +++ b/mindspore/python/mindspore/ops/operations/random_ops.py @@ -53,7 +53,7 @@ class NonDeterministicInts(Primitive): ValueError: If the number of elements of output is more than 1000000. Supported Platforms: - ``Ascend`` ``CPU`` + ``CPU`` Examples: >>> shape = Tensor(np.array([2,2]), mstype.int32) @@ -108,7 +108,7 @@ class TruncatedNormal(Primitive): ValueError: If the number of elements of output is more than 1000000. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> shape = Tensor(np.array([2, 2]), mstype.int32) @@ -479,7 +479,7 @@ class ParameterizedTruncatedNormal(Primitive): ValueError: If `shape` is not a 1-D tensor. Supported Platforms: - ``Ascend`` ``CPU`` + ``CPU`` Examples: >>> shape = Tensor(np.array([2, 3]), mstype.int32) @@ -848,7 +848,7 @@ class Multinomial(Primitive): ValueError: If `seed` or `seed2` is less than 0. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> x = Tensor([[0., 9., 4., 0.]], mstype.float32) diff --git a/mindspore/python/mindspore/ops/operations/sparse_ops.py b/mindspore/python/mindspore/ops/operations/sparse_ops.py index a4924d4cb50..1d3fd2893eb 100644 --- a/mindspore/python/mindspore/ops/operations/sparse_ops.py +++ b/mindspore/python/mindspore/ops/operations/sparse_ops.py @@ -277,7 +277,7 @@ class SparseSparseMaximum(Primitive): ValueError: If the `x1_shape` and `x2_shape` mismatch with each other. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> x1_indices = Tensor([[0, 1], [1, 2]]) @@ -331,7 +331,7 @@ class SetSize(Primitive): parameter description. Supported Platforms: - ``Ascend`` ``CPU`` + ``CPU`` Examples: >>> set_indices = Tensor(np.array([[0, 1], [1, 2]]).astype(np.int64)) @@ -379,7 +379,7 @@ class SparseReorder(Primitive): ValueError: If `shape` the first dimension length is not equal the second dimension length of 'indices'. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> import mindspore.common.dtype as ms @@ -525,7 +525,7 @@ class SparseSoftmax(Primitive): ValueError: If the size of shape < 2. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> indices = Tensor([[0,0], [0,3], [1,2], [1,5], [2,0], [2,5]]) @@ -799,7 +799,7 @@ class DenseToCSRSparseMatrix(Primitive): ValueError: If shape[1] of `indices` and rank of `dense_input` is not the same. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> x = Tensor([[[1., 0.], [0., 2.]]], dtype=mindspore.float32) @@ -864,7 +864,7 @@ class DenseToDenseSetOperation(Primitive): ValueError: If the value of attr set_operation is not a valid value. Supported Platforms: - ``Ascend`` ``CPU`` + ``CPU`` Examples: >>> x1 = Tensor([[2, 2, 0], [2, 2, 1], [0, 2, 2]], dtype=mstype.int32) @@ -961,7 +961,7 @@ class Sspaddmm(Primitive): ValueError: If the shape of `alpha`, `beta` is not () or (1,). Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> x1_indices = Tensor(np.array([[0, 1], [0, 1]]), mstype.int64) @@ -1033,7 +1033,7 @@ class SparseAddmm(Primitive): RuntimeError: If `x1_shape`, shape of `x2`, shape of `x3` don't meet the parameter description. Supported Platforms: - ``Ascend`` ``CPU`` + ``CPU`` Examples: >>> indices = Tensor([[0, 1], [1, 2]], dtype=ms.int32) @@ -1088,7 +1088,7 @@ class SparseConcat(Primitive): Error: If input axis value is not in range [-rank, rank). Supported Platforms: - ``Ascend`` ``CPU`` + ``CPU`` Examples: >>> indices0 = Tensor([[0, 1], [1, 2]], dtype=mstype.int64) @@ -1251,7 +1251,7 @@ class SparseSegmentSqrtN(Primitive): ValueError: If `indices` is out of range of x's first dimension. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> x = Tensor(np.array([[1,2,3,4],[5,6,7,8],[9,10,11,12]]).astype(np.float32)) @@ -1313,7 +1313,7 @@ class SparseSegmentSqrtNWithNumSegments(Primitive): ValueError: If `indices` is out of range of x's first dimension. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> x = Tensor([[0, 1, 0, 0], [0, 1, 1, 0], [1, 0, 1, 0]], dtype=ms.float16) @@ -1373,7 +1373,7 @@ class SparseMatrixNNZ(Primitive): ValueError: If shape[0] of `x_dense_shape` is not 2 or 3. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> dense_shape = Tensor([2,3], dtype=mstype.int32) @@ -1487,7 +1487,7 @@ class SparseSegmentMeanWithNumSegments(Primitive): ValueError: If `indices` is out of range of x's first dimension. Supported Platforms: - ``Ascend`` ``CPU`` + ``CPU`` Examples: >>> x = Tensor([[0, 2, 0, 0], [0, 1, 1, 0], [2, 0, 2, 0]], dtype=ms.float16) @@ -1675,7 +1675,7 @@ class CSRSparseMatrixToDense(Primitive): ValueError: If shape[0] of `x_dense_shape` is not 2 or 3. Supported Platforms: - ``Ascend`` ``CPU`` + ``CPU`` Examples: >>> dense_shape = Tensor([2, 2], dtype=mindspore.int32) @@ -1754,7 +1754,7 @@ class SparseMatrixTranspose(Primitive): TypeError: The input data should have the correct CSR form. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> from mindspore.ops import operations as ops @@ -1827,7 +1827,7 @@ class SparseSparseMinimum(Primitive): ValueError: If shape[0] of `x1_shape` is not corresponding to shape[0] of `x2_shape`. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> from mindspore.ops.operations.sparse_ops import SparseSparseMinimum diff --git a/mindspore/python/mindspore/ops/operations/spectral_ops.py b/mindspore/python/mindspore/ops/operations/spectral_ops.py index 802af8601b5..6f33b2777e0 100644 --- a/mindspore/python/mindspore/ops/operations/spectral_ops.py +++ b/mindspore/python/mindspore/ops/operations/spectral_ops.py @@ -53,7 +53,7 @@ class BlackmanWindow(Primitive): Refer to :func:`mindspore.ops.blackman_window` for more details. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> window_length = Tensor(10, mindspore.int32)