usr mindspore. instead of mstype.

This commit is contained in:
guohongzilong 2020-04-07 20:39:51 +08:00
parent 9e17b996c7
commit c4f9230f03
6 changed files with 12 additions and 11 deletions

View File

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

View File

@ -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.')

View File

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

View File

@ -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.]]]]

View File

@ -1908,8 +1908,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]]

View File

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