From e17e08618649522a37d83d011bbb613b0df3675c Mon Sep 17 00:00:00 2001 From: guohongzilong <2713219276@qq.com> Date: Wed, 8 Apr 2020 18:00:33 +0800 Subject: [PATCH] unified tensor and mindspore.type --- mindspore/common/tensor.py | 8 ++++---- mindspore/ops/operations/math_ops.py | 6 +++--- mindspore/ops/operations/random_ops.py | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mindspore/common/tensor.py b/mindspore/common/tensor.py index d17661595f6..709b2ae2805 100644 --- a/mindspore/common/tensor.py +++ b/mindspore/common/tensor.py @@ -42,14 +42,14 @@ class Tensor(Tensor_): Examples: >>> # init a tensor with input data - >>> t1 = mindspore.Tensor(np.zeros([1, 2, 3]), mindspore.float32) - >>> assert isinstance(t1, mindspore.Tensor) + >>> t1 = Tensor(np.zeros([1, 2, 3]), mindspore.float32) + >>> assert isinstance(t1, Tensor) >>> assert t1.shape() == (1, 2, 3) >>> assert t1.dtype() == mindspore.float32 >>> >>> # init a tensor with a float scalar - >>> t2 = mindspore.Tensor(0.1) - >>> assert isinstance(t2, mindspore.Tensor) + >>> t2 = Tensor(0.1) + >>> assert isinstance(t2, Tensor) >>> assert t2.dtype() == mindspore.float64 """ diff --git a/mindspore/ops/operations/math_ops.py b/mindspore/ops/operations/math_ops.py index 47b9e490f16..d003f6ee8b3 100644 --- a/mindspore/ops/operations/math_ops.py +++ b/mindspore/ops/operations/math_ops.py @@ -1208,7 +1208,7 @@ class Acosh(PrimitiveWithInfer): Examples: >>> acosh = Acosh() - >>> X = Tensor(np.array([1.0, 1.5, 3.0, 100.0]), ms.float32) + >>> X = Tensor(np.array([1.0, 1.5, 3.0, 100.0]), mindspore.float32) >>> output = acosh(X) """ @@ -1752,7 +1752,7 @@ class Cos(PrimitiveWithInfer): Examples: >>> cos = P.Cos() - >>> X = Tensor(np.array([0.24, 0.83, 0.31, 0.09]), ms.float32) + >>> X = Tensor(np.array([0.24, 0.83, 0.31, 0.09]), mindspore.float32) >>> output = cos(X) """ @@ -1808,7 +1808,7 @@ class Sin(PrimitiveWithInfer): Examples: >>> sin = P.Sin() - >>> input_x = Tensor(np.array([0.62, 0.28, 0.43, 0.62]), ms.float32) + >>> input_x = Tensor(np.array([0.62, 0.28, 0.43, 0.62]), mindspore.float32) >>> output = sin(input_x) """ diff --git a/mindspore/ops/operations/random_ops.py b/mindspore/ops/operations/random_ops.py index 9ef5b301f97..95692a622e2 100644 --- a/mindspore/ops/operations/random_ops.py +++ b/mindspore/ops/operations/random_ops.py @@ -45,7 +45,7 @@ class RandomChoiceWithMask(PrimitiveWithInfer): Examples: >>> rnd_choice_mask = RandomChoiceWithMask() - >>> input_x = Tensor(np.ones(shape=[240000, 4]), ms.bool_) + >>> input_x = Tensor(np.ones(shape=[240000, 4]), mindspore.bool_) >>> output_y, output_mask = rnd_choice_mask(input_x) """