From 0a04bbdc4ee5ab13ae0d0ce47b205f2972b3d067 Mon Sep 17 00:00:00 2001 From: zhangz0911gm Date: Sat, 28 Nov 2020 15:54:23 +0800 Subject: [PATCH] fix errors in notes in clesses' example --- mindspore/ops/composite/random_ops.py | 4 ++-- mindspore/ops/operations/array_ops.py | 11 ++++++----- mindspore/ops/operations/math_ops.py | 6 +++--- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/mindspore/ops/composite/random_ops.py b/mindspore/ops/composite/random_ops.py index 50302c8beb..b48e9aea25 100644 --- a/mindspore/ops/composite/random_ops.py +++ b/mindspore/ops/composite/random_ops.py @@ -128,13 +128,13 @@ def uniform(shape, minval, maxval, seed=None, dtype=mstype.float32): The dtype is designated as the input `dtype`. Examples: - >>> For discrete uniform distribution, only one number is allowed for both minval and maxval: + >>> # For discrete uniform distribution, only one number is allowed for both minval and maxval: >>> shape = (4, 2) >>> minval = Tensor(1, mstype.int32) >>> maxval = Tensor(2, mstype.int32) >>> output = C.uniform(shape, minval, maxval, seed=5, dtype=mstype.int32) >>> - >>> For continuous uniform distribution, minval and maxval can be multi-dimentional: + >>> # For continuous uniform distribution, minval and maxval can be multi-dimentional: >>> shape = (4, 2) >>> minval = Tensor([1.0, 2.0], mstype.float32) >>> maxval = Tensor([4.0, 5.0], mstype.float32) diff --git a/mindspore/ops/operations/array_ops.py b/mindspore/ops/operations/array_ops.py index 0bd85e3143..bc8e5f7b05 100644 --- a/mindspore/ops/operations/array_ops.py +++ b/mindspore/ops/operations/array_ops.py @@ -1151,8 +1151,8 @@ class Ones(PrimitiveWithInfer): >>> ones = ops.Ones() >>> output = ones((2, 2), mindspore.float32) >>> print(output) - [[1.0, 1.0], - [1.0, 1.0]] + [[1. 1.] + [1. 1.]] """ @prim_attr_register @@ -1204,8 +1204,8 @@ class Zeros(PrimitiveWithInfer): >>> zeros = ops.Zeros() >>> output = zeros((2, 2), mindspore.float32) >>> print(output) - [[0.0, 0.0], - [0.0, 0.0]] + [[0. 0.] + [0. 0.]] """ @@ -3347,7 +3347,8 @@ class ScatterSub(_ScatterOp): >>> scatter_sub = ops.ScatterSub() >>> output = scatter_sub(input_x, indices, updates) >>> print(output) - [[-1.0, -1.0, -1.0], [-1.0, -1.0, -1.0]] + [[-1. -1. -1.] + [-1. -1. -1.]] """ diff --git a/mindspore/ops/operations/math_ops.py b/mindspore/ops/operations/math_ops.py index c6258639ee..fe8d85fd0f 100644 --- a/mindspore/ops/operations/math_ops.py +++ b/mindspore/ops/operations/math_ops.py @@ -1376,8 +1376,8 @@ class Rsqrt(PrimitiveWithInfer): >>> rsqrt = ops.Rsqrt() >>> output = rsqrt(input_tensor) >>> print(output) - [[0.5 0.5 ] - [0.333334 0.333334]] + [[0.5 0.5 ] + [0.33333334 0.33333334]] """ @prim_attr_register @@ -1677,7 +1677,7 @@ class Log(PrimitiveWithInfer): >>> log = ops.Log() >>> output = log(input_x) >>> print(output) - [0. 0.6931472 1.38629444] + [0. 0.6931472 1.3862944] """ @prim_attr_register