Browse Source

!11595 [Numpy-Native] dostrings bug fix

From: @jachua
Reviewed-by: @zhunaipan,@liangchenghui
Signed-off-by: @liangchenghui
tags/v1.2.0-rc1
mindspore-ci-bot Gitee 4 years ago
parent
commit
d970b01481
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      mindspore/numpy/array_ops.py

+ 6
- 6
mindspore/numpy/array_ops.py View File

@@ -765,7 +765,7 @@ def atleast_1d(*arys):

Examples:
>>> a = np.ones((2, 3))
>>> b = np.ones(0)
>>> b = np.ones(())
>>> c = np.ones(5)
>>> output = np.atleast_1d(a, b, c)
>>> print(output)
@@ -801,7 +801,7 @@ def atleast_2d(*arys):

Examples:
>>> a = np.ones((2, 3))
>>> b = np.ones(0)
>>> b = np.ones(())
>>> c = np.ones(5)
>>> output = np.atleast_2d(a, b, c)
>>> print(output)
@@ -840,7 +840,7 @@ def atleast_3d(*arys):

Examples:
>>> a = np.ones((2, 3))
>>> b = np.ones(0)
>>> b = np.ones(())
>>> c = np.ones(5)
>>> output = np.atleast_3d(a, b, c)
>>> print(output)
@@ -972,13 +972,13 @@ def unique(x, return_inverse=False):
>>> import numpy as onp
>>> from mindspore import context
>>> context.set_context(mode=context.GRAPH_MODE)
>>> input_x = mnp.asarray(onp.array([1, 2, 2, 2, 3, 4, 5]).astype('float32'))
>>> input_x = mnp.asarray(onp.array([1, 2, 2, 2, 3, 4, 5]).astype('int32'))
>>> output_x = mnp.unique(input_x)
>>> print(output_x)
[1. 2. 3. 4. 5.]
[1, 2, 3, 4, 5]
>>> output_x = mnp.unique(input_x, return_inverse=True)
>>> print(output_x)
(Tensor(shape=[5], dtype=Float32, value= [ 1. 2. 3. 4. 5.]), Tensor(shape=[7], dtype=Int32,
(Tensor(shape=[5], dtype=Int32, value= [ 1, 2, 3, 4, 5]), Tensor(shape=[7], dtype=Int32,
value= [0, 1, 1, 1, 2, 3, 4]))
"""
if not _check_is_tensor(F.typeof(x)):


Loading…
Cancel
Save