提交 e17e0861 编写于 作者: G guohongzilong

unified tensor and mindspore.type

上级 dd9a5a38
......@@ -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
"""
......
......@@ -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)
"""
......
......@@ -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)
"""
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册