Merge pull request !179 from ghzl/improve-example-in-me-fronttags/v0.2.0-alpha
| @@ -42,14 +42,14 @@ class Tensor(Tensor_): | |||||
| Examples: | Examples: | ||||
| >>> # init a tensor with input data | >>> # 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.shape() == (1, 2, 3) | ||||
| >>> assert t1.dtype() == mindspore.float32 | >>> assert t1.dtype() == mindspore.float32 | ||||
| >>> | >>> | ||||
| >>> # init a tensor with a float scalar | >>> # 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 | >>> assert t2.dtype() == mindspore.float64 | ||||
| """ | """ | ||||
| @@ -1208,7 +1208,7 @@ class Acosh(PrimitiveWithInfer): | |||||
| Examples: | Examples: | ||||
| >>> acosh = Acosh() | >>> 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) | >>> output = acosh(X) | ||||
| """ | """ | ||||
| @@ -1752,7 +1752,7 @@ class Cos(PrimitiveWithInfer): | |||||
| Examples: | Examples: | ||||
| >>> cos = P.Cos() | >>> 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) | >>> output = cos(X) | ||||
| """ | """ | ||||
| @@ -1808,7 +1808,7 @@ class Sin(PrimitiveWithInfer): | |||||
| Examples: | Examples: | ||||
| >>> sin = P.Sin() | >>> 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) | >>> output = sin(input_x) | ||||
| """ | """ | ||||
| @@ -45,7 +45,7 @@ class RandomChoiceWithMask(PrimitiveWithInfer): | |||||
| Examples: | Examples: | ||||
| >>> rnd_choice_mask = RandomChoiceWithMask() | >>> 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) | >>> output_y, output_mask = rnd_choice_mask(input_x) | ||||
| """ | """ | ||||