diff --git a/mindspore/common/api.py b/mindspore/common/api.py index 5a74febe53f961b8b52071a3ba5ee75f10c19deb..7f0b2bfeaadcf6fa630b99b9cb2bcaef963f8b5d 100644 --- a/mindspore/common/api.py +++ b/mindspore/common/api.py @@ -230,8 +230,8 @@ def ms_function(fn=None, obj=None, input_signature=None): >>> z = F.tensor_add(x, y) >>> return z >>> - >>> @ms_function(input_signature=(MetaTensor(mstype.float32, (1, 1, 3, 3)), - >>> MetaTensor(mstype.float32, (1, 1, 3, 3)))) + >>> @ms_function(input_signature=(MetaTensor(mindspore.float32, (1, 1, 3, 3)), + >>> MetaTensor(mindspore.float32, (1, 1, 3, 3)))) >>> def tensor_add_with_sig(x, y): >>> z = F.tensor_add(x, y) >>> return z diff --git a/mindspore/common/initializer.py b/mindspore/common/initializer.py index bdc3418129d0b7cc8f9ac8259e58f65646ca85b5..4261621272aa729ae8d6ecf6a86ad15aca2eba92 100644 --- a/mindspore/common/initializer.py +++ b/mindspore/common/initializer.py @@ -282,7 +282,7 @@ def initializer(init, shape=None, dtype=mstype.float32): Tensor, initialized tensor. Examples: - >>> tensor = initializer('ones', [1, 2, 3], mstype.float32) + >>> tensor = initializer('ones', [1, 2, 3], mindspore.float32) """ if not isinstance(init, (Tensor, numbers.Number, str, Initializer)): raise TypeError('Unsupported init type.') diff --git a/mindspore/dataset/engine/datasets.py b/mindspore/dataset/engine/datasets.py index de604a67e9d7068d9e46ef3cbfe2a7003580692a..ab2290c13c103b4894239ae2cd63046b6a856929 100644 --- a/mindspore/dataset/engine/datasets.py +++ b/mindspore/dataset/engine/datasets.py @@ -1814,7 +1814,7 @@ class TFRecordDataset(SourceDataset): >>> tfdataset = ds.TFRecordDataset(dataset_files=dataset_files) >>> # 2) get all rows from dataset_files with user-defined schema: >>> schema = ds.Schema() - >>> schema.add_column('col_1d', de_type=mstype.int64, shape=[2]) + >>> schema.add_column('col_1d', de_type=mindspore.int64, shape=[2]) >>> tfdataset = ds.TFRecordDataset(dataset_files=dataset_files, schema=schema) >>> # 3) get all rows from dataset_files with schema file "./schema.json": >>> tfdataset = ds.TFRecordDataset(dataset_files=dataset_files, schema="./schema.json") @@ -2325,7 +2325,7 @@ class Schema: >>> import mindspore.common.dtype as mstype >>> # create schema, specify column name, mindspore.dtype and shape of the column >>> schema = ds.Schema() - >>> schema.add_column('col1', de_type=mstype.int64, shape=[2]) + >>> schema.add_column('col1', de_type=mindspore.int64, shape=[2]) """ def __init__(self, schema_file=None): diff --git a/mindspore/ops/operations/array_ops.py b/mindspore/ops/operations/array_ops.py index fdad46a31f5a1abb0c044337a86ab1bc454555ec..b91c2cbc7d5c8ad206a3945743c8d81346e8ba13 100644 --- a/mindspore/ops/operations/array_ops.py +++ b/mindspore/ops/operations/array_ops.py @@ -1535,7 +1535,8 @@ class StridedSlice(PrimitiveWithInfer): - Finally, the output is [3, 3, 3]. Examples - >>> input_x = Tensor([[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]], [[5, 5, 5], [6, 6, 6]]]) + >>> input_x = Tensor([[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]], + >>> [[5, 5, 5], [6, 6, 6]]], mindspore.float32) >>> slice = StridedSlice() >>> output = slice(input_x, (1, 0, 0), (2, 1, 3), (1, 1, 1)) >>> output.shape() @@ -2067,7 +2068,7 @@ class SpaceToBatch(PrimitiveWithInfer): >>> block_size = 2 >>> paddings = [[0, 0], [0, 0]] >>> space_to_batch = P.SpaceToBatch(block_size, paddings) - >>> x = Tensor(np.array([[[[1, 2], [3, 4]]]]), mstype.float32) + >>> x = Tensor(np.array([[[[1, 2], [3, 4]]]]), mindspore.float32) >>> space_to_batch(x) [[[[1.]]], [[[2.]]], [[[3.]]], [[[4.]]]] @@ -2135,7 +2136,7 @@ class BatchToSpace(PrimitiveWithInfer): >>> block_size = 2 >>> crops = [[0, 0], [0, 0]] >>> op = P.BatchToSpace(block_size, crops) - >>> x = Tensor(np.array([[[[1]]], [[[2]]], [[[3]]], [[[4]]]]), mstype.float32) + >>> x = Tensor(np.array([[[[1]]], [[[2]]], [[[3]]], [[[4]]]]), mindspore.float32) >>> output = op(x) [[[[1., 2.], [3., 4.]]]] diff --git a/mindspore/ops/operations/math_ops.py b/mindspore/ops/operations/math_ops.py index 127d3c513c1b0c96e3ed3b3c8d7f49d3c0b4fe9a..47b9e490f162cb4b72ac6c612de92ad253692625 100644 --- a/mindspore/ops/operations/math_ops.py +++ b/mindspore/ops/operations/math_ops.py @@ -1996,8 +1996,8 @@ class Atan2(_MathBinaryOp): Tensor, the shape is same as the shape after broadcasting, and the data type is same as 'input_x'. Examples: - >>> input_x = Tensor(np.array([[0, 1]]), mstype.float32) - >>> input_y = Tensor(np.array([[1, 1]]), mstype.float32) + >>> input_x = Tensor(np.array([[0, 1]]), mindspore.float32) + >>> input_y = Tensor(np.array([[1, 1]]), mindspore.float32) >>> atan2 = P.Atan2() >>> atan2(input_x, input_y) [[0. 0.7853982]] diff --git a/mindspore/train/model.py b/mindspore/train/model.py index bcfd897f587893fa1c279298154782986c0ccc82..41b372f85aa36c8f0987fef496061cbe82bfcf5d 100755 --- a/mindspore/train/model.py +++ b/mindspore/train/model.py @@ -528,7 +528,7 @@ class Model: Tensor, array(s) of predictions. Examples: - >>> input_data = Tensor(np.random.randint(0, 255, [1, 3, 224, 224]), mstype.float32) + >>> input_data = Tensor(np.random.randint(0, 255, [1, 3, 224, 224]), mindspore.float32) >>> model = Model(Net()) >>> model.predict(input_data) """