unified tensor and mindspore.type

This commit is contained in:
guohongzilong 2020-04-08 18:00:33 +08:00
parent dd9a5a385a
commit e17e086186
3 changed files with 8 additions and 8 deletions

View File

@ -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
"""

View File

@ -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)
"""

View File

@ -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)
"""