Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
6d5c580a
M
mindspore
项目概览
magicwindyyd
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
1
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看板
提交
6d5c580a
编写于
7月 16, 2020
作者:
B
buxue
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change shape and dtype of tensor from interface to attr
上级
4936fe48
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
8 addition
and
8 deletion
+8
-8
mindspore/nn/graph_kernels/graph_kernels.py
mindspore/nn/graph_kernels/graph_kernels.py
+1
-1
mindspore/nn/layer/quant.py
mindspore/nn/layer/quant.py
+3
-3
model_zoo/gat/src/gat.py
model_zoo/gat/src/gat.py
+3
-3
tests/st/pynative/test_ops.py
tests/st/pynative/test_ops.py
+1
-1
未找到文件。
mindspore/nn/graph_kernels/graph_kernels.py
浏览文件 @
6d5c580a
...
...
@@ -1020,7 +1020,7 @@ class LayerNorm(Cell):
Examples:
>>> x = Tensor(np.ones([20, 5, 10, 10]), mindspore.float32)
>>> shape1 = x.shape
()
[1:]
>>> shape1 = x.shape[1:]
>>> m = G.LayerNorm(shape1, begin_norm_axis=1, begin_params_axis=1)
>>> m(x)
"""
...
...
mindspore/nn/layer/quant.py
浏览文件 @
6d5c580a
...
...
@@ -746,8 +746,8 @@ class DenseQuant(Cell):
self
.
has_bias
=
check_bool
(
has_bias
)
if
isinstance
(
weight_init
,
Tensor
):
if
weight_init
.
dim
()
!=
2
or
weight_init
.
shape
()
[
0
]
!=
out_channels
or
\
weight_init
.
shape
()
[
1
]
!=
in_channels
:
if
weight_init
.
dim
()
!=
2
or
weight_init
.
shape
[
0
]
!=
out_channels
or
\
weight_init
.
shape
[
1
]
!=
in_channels
:
raise
ValueError
(
"weight_init shape error"
)
self
.
weight
=
Parameter
(
initializer
(
...
...
@@ -755,7 +755,7 @@ class DenseQuant(Cell):
if
self
.
has_bias
:
if
isinstance
(
bias_init
,
Tensor
):
if
bias_init
.
dim
()
!=
1
or
bias_init
.
shape
()
[
0
]
!=
out_channels
:
if
bias_init
.
dim
()
!=
1
or
bias_init
.
shape
[
0
]
!=
out_channels
:
raise
ValueError
(
"bias_init shape error"
)
self
.
bias
=
Parameter
(
initializer
(
...
...
model_zoo/gat/src/gat.py
浏览文件 @
6d5c580a
...
...
@@ -77,15 +77,15 @@ class GNNFeatureTransform(nn.Cell):
self
.
has_bias
=
check_bool
(
has_bias
)
if
isinstance
(
weight_init
,
Tensor
):
if
weight_init
.
dim
()
!=
2
or
weight_init
.
shape
()
[
0
]
!=
out_channels
or
\
weight_init
.
shape
()
[
1
]
!=
in_channels
:
if
weight_init
.
dim
()
!=
2
or
weight_init
.
shape
[
0
]
!=
out_channels
or
\
weight_init
.
shape
[
1
]
!=
in_channels
:
raise
ValueError
(
"weight_init shape error"
)
self
.
weight
=
Parameter
(
initializer
(
weight_init
,
[
out_channels
,
in_channels
]),
name
=
"weight"
)
if
self
.
has_bias
:
if
isinstance
(
bias_init
,
Tensor
):
if
bias_init
.
dim
()
!=
1
or
bias_init
.
shape
()
[
0
]
!=
out_channels
:
if
bias_init
.
dim
()
!=
1
or
bias_init
.
shape
[
0
]
!=
out_channels
:
raise
ValueError
(
"bias_init shape error"
)
self
.
bias
=
Parameter
(
initializer
(
bias_init
,
[
out_channels
]),
name
=
"bias"
)
...
...
tests/st/pynative/test_ops.py
浏览文件 @
6d5c580a
...
...
@@ -28,4 +28,4 @@ def test_cast():
type_dst
=
ms
.
float32
cast
=
P
.
Cast
()
result
=
cast
(
input_x
,
type_dst
)
assert
result
.
dtype
()
==
type_dst
assert
result
.
dtype
==
type_dst
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录