Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
正统之独孤求败
mindspore
提交
14c5c1b5
M
mindspore
项目概览
正统之独孤求败
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindspore
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
14c5c1b5
编写于
4月 07, 2020
作者:
G
guohongzilong
提交者:
高东海
4月 10, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
usr mindspore. instead of mstype.
上级
5b915155
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
12 addition
and
11 deletion
+12
-11
mindspore/common/api.py
mindspore/common/api.py
+2
-2
mindspore/common/initializer.py
mindspore/common/initializer.py
+1
-1
mindspore/dataset/engine/datasets.py
mindspore/dataset/engine/datasets.py
+2
-2
mindspore/ops/operations/array_ops.py
mindspore/ops/operations/array_ops.py
+4
-3
mindspore/ops/operations/math_ops.py
mindspore/ops/operations/math_ops.py
+2
-2
mindspore/train/model.py
mindspore/train/model.py
+1
-1
未找到文件。
mindspore/common/api.py
浏览文件 @
14c5c1b5
...
...
@@ -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(m
styp
e.float32, (1, 1, 3, 3)),
>>> MetaTensor(m
styp
e.float32, (1, 1, 3, 3))))
>>> @ms_function(input_signature=(MetaTensor(m
indspor
e.float32, (1, 1, 3, 3)),
>>> MetaTensor(m
indspor
e.float32, (1, 1, 3, 3))))
>>> def tensor_add_with_sig(x, y):
>>> z = F.tensor_add(x, y)
>>> return z
...
...
mindspore/common/initializer.py
浏览文件 @
14c5c1b5
...
...
@@ -282,7 +282,7 @@ def initializer(init, shape=None, dtype=mstype.float32):
Tensor, initialized tensor.
Examples:
>>> tensor = initializer('ones', [1, 2, 3], m
styp
e.float32)
>>> tensor = initializer('ones', [1, 2, 3], m
indspor
e.float32)
"""
if
not
isinstance
(
init
,
(
Tensor
,
numbers
.
Number
,
str
,
Initializer
)):
raise
TypeError
(
'Unsupported init type.'
)
...
...
mindspore/dataset/engine/datasets.py
浏览文件 @
14c5c1b5
...
...
@@ -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=m
styp
e.int64, shape=[2])
>>> schema.add_column('col_1d', de_type=m
indspor
e.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=m
styp
e.int64, shape=[2])
>>> schema.add_column('col1', de_type=m
indspor
e.int64, shape=[2])
"""
def
__init__
(
self
,
schema_file
=
None
):
...
...
mindspore/ops/operations/array_ops.py
浏览文件 @
14c5c1b5
...
...
@@ -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]]]]), m
styp
e.float32)
>>> x = Tensor(np.array([[[[1, 2], [3, 4]]]]), m
indspor
e.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]]]]), m
styp
e.float32)
>>> x = Tensor(np.array([[[[1]]], [[[2]]], [[[3]]], [[[4]]]]), m
indspor
e.float32)
>>> output = op(x)
[[[[1., 2.], [3., 4.]]]]
...
...
mindspore/ops/operations/math_ops.py
浏览文件 @
14c5c1b5
...
...
@@ -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]]), m
styp
e.float32)
>>> input_y = Tensor(np.array([[1, 1]]), m
styp
e.float32)
>>> input_x = Tensor(np.array([[0, 1]]), m
indspor
e.float32)
>>> input_y = Tensor(np.array([[1, 1]]), m
indspor
e.float32)
>>> atan2 = P.Atan2()
>>> atan2(input_x, input_y)
[[0. 0.7853982]]
...
...
mindspore/train/model.py
浏览文件 @
14c5c1b5
...
...
@@ -528,7 +528,7 @@ class Model:
Tensor, array(s) of predictions.
Examples:
>>> input_data = Tensor(np.random.randint(0, 255, [1, 3, 224, 224]), m
styp
e.float32)
>>> input_data = Tensor(np.random.randint(0, 255, [1, 3, 224, 224]), m
indspor
e.float32)
>>> model = Model(Net())
>>> model.predict(input_data)
"""
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录