Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
113641de
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看板
提交
113641de
编写于
8月 25, 2020
作者:
H
huangdongrun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix test cases
上级
7d4f4818
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
15 deletion
+18
-15
tests/ut/python/pynative_mode/test_cont_cases.py
tests/ut/python/pynative_mode/test_cont_cases.py
+18
-15
未找到文件。
tests/ut/python/pynative_mode/test_cont_cases.py
浏览文件 @
113641de
...
...
@@ -26,6 +26,9 @@ from mindspore.ops import operations as P
# from tests.vm_impl.vm_interface import *
# from tests.vm_impl import *
grad_by_list
=
C
.
GradOperation
(
'get_by_list'
,
get_by_list
=
True
)
grad_all
=
C
.
GradOperation
(
'get_all'
,
get_all
=
True
)
def
setup_module
():
context
.
set_context
(
mode
=
context
.
PYNATIVE_MODE
,
enable_sparse
=
False
)
...
...
@@ -86,7 +89,7 @@ def test_while_opt_endless():
@
ms_function
def
construct
(
self
,
*
inputs
):
return
C
.
grad_all
(
self
.
net
)(
*
inputs
)
return
grad_all
(
self
.
net
)(
*
inputs
)
while_net
=
MyWhileNet
()
net
=
GradNet
(
while_net
)
...
...
@@ -149,7 +152,7 @@ def test_while_with_param_grad_with_const_branch():
@
ms_function
def
construct
(
self
,
a
,
b
,
c
):
return
C
.
grad_by_list
(
self
.
net
,
self
.
weights
)(
a
,
b
,
c
)
return
grad_by_list
(
self
.
net
,
self
.
weights
)(
a
,
b
,
c
)
while_net
=
MyWhileNet
()
net
=
GradNet
(
while_net
)
...
...
@@ -189,7 +192,7 @@ def test_for_while_with_param_grad_with_const_branch():
@
ms_function
def
construct
(
self
,
a
,
b
,
c
):
return
C
.
grad_by_list
(
self
.
net
,
self
.
weights
)(
a
,
b
,
c
)
return
grad_by_list
(
self
.
net
,
self
.
weights
)(
a
,
b
,
c
)
while_net
=
MyWhileNet
()
net
=
GradNet
(
while_net
)
...
...
@@ -226,7 +229,7 @@ def test_for_while_with_param_grad_basic():
@
ms_function
def
construct
(
self
,
a
,
b
,
c
):
return
C
.
grad_by_list
(
self
.
net
,
self
.
weights
)(
a
,
b
,
c
)
return
grad_by_list
(
self
.
net
,
self
.
weights
)(
a
,
b
,
c
)
while_net
=
MyWhileNet
()
net
=
GradNet
(
while_net
)
...
...
@@ -263,7 +266,7 @@ def test_for_while_with_param_grad_normal():
@
ms_function
def
construct
(
self
,
a
,
b
,
c
):
return
C
.
grad_by_list
(
self
.
net
,
self
.
weights
)(
a
,
b
,
c
)
return
grad_by_list
(
self
.
net
,
self
.
weights
)(
a
,
b
,
c
)
while_net
=
MyWhileNet
()
net
=
GradNet
(
while_net
)
...
...
@@ -297,7 +300,7 @@ def test_while_with_param_basic_grad():
@
ms_function
def
construct
(
self
,
a
,
b
,
c
):
return
C
.
grad_by_list
(
self
.
net
,
self
.
weights
)(
a
,
b
,
c
)
return
grad_by_list
(
self
.
net
,
self
.
weights
)(
a
,
b
,
c
)
while_net
=
MyWhileNet
()
net
=
GradNet
(
while_net
)
...
...
@@ -331,7 +334,7 @@ def test_while_with_param_basic_grad_mul():
@
ms_function
def
construct
(
self
,
a
,
b
,
c
):
return
C
.
grad_by_list
(
self
.
net
,
self
.
weights
)(
a
,
b
,
c
)
return
grad_by_list
(
self
.
net
,
self
.
weights
)(
a
,
b
,
c
)
while_net
=
MyWhileNet
()
net
=
GradNet
(
while_net
)
...
...
@@ -366,7 +369,7 @@ def test_while_with_param_basic_grad_two():
@
ms_function
def
construct
(
self
,
a
,
b
,
c
):
return
C
.
grad_by_list
(
self
.
net
,
self
.
weights
)(
a
,
b
,
c
)
return
grad_by_list
(
self
.
net
,
self
.
weights
)(
a
,
b
,
c
)
while_net
=
MyWhileNet
()
net
=
GradNet
(
while_net
)
...
...
@@ -402,7 +405,7 @@ def test_while_with_param_basic_grad_three():
@
ms_function
def
construct
(
self
,
a
,
b
,
c
):
return
C
.
grad_by_list
(
self
.
net
,
self
.
weights
)(
a
,
b
,
c
)
return
grad_by_list
(
self
.
net
,
self
.
weights
)(
a
,
b
,
c
)
while_net
=
MyWhileNet
()
net
=
GradNet
(
while_net
)
...
...
@@ -439,7 +442,7 @@ def test_while_if_with_param_grad():
@
ms_function
def
construct
(
self
,
a
,
b
,
c
):
return
C
.
grad_by_list
(
self
.
net
,
self
.
weights
)(
a
,
b
,
c
)
return
grad_by_list
(
self
.
net
,
self
.
weights
)(
a
,
b
,
c
)
while_net
=
MyWhileNet
()
net
=
GradNet
(
while_net
)
...
...
@@ -472,7 +475,7 @@ def test_while_with_param_grad_not_enter_while():
@
ms_function
def
construct
(
self
,
a
,
b
,
c
):
return
C
.
grad_by_list
(
self
.
net
,
self
.
weights
)(
a
,
b
,
c
)
return
grad_by_list
(
self
.
net
,
self
.
weights
)(
a
,
b
,
c
)
while_net
=
MyWhileNet
()
net
=
GradNet
(
while_net
)
...
...
@@ -534,7 +537,7 @@ def test_with_param_if_by_if_grad_inputs():
@
ms_function
def
construct
(
self
,
*
inputs
):
return
C
.
grad_all
(
self
.
net
)(
*
inputs
)
return
grad_all
(
self
.
net
)(
*
inputs
)
if_net
=
MyIfByIfNet
()
net
=
GradNet
(
if_net
)
...
...
@@ -568,7 +571,7 @@ def test_with_param_if_by_if_grad_parameter():
@
ms_function
def
construct
(
self
,
*
inputs
):
return
C
.
grad_by_list
(
self
.
net
,
self
.
weights
)(
*
inputs
)
return
grad_by_list
(
self
.
net
,
self
.
weights
)(
*
inputs
)
if_net
=
MyIfByIfNet
()
net
=
GradNet
(
if_net
)
...
...
@@ -600,7 +603,7 @@ def test_with_param_if_by_if_grad_param_excute_null():
@
ms_function
def
construct
(
self
,
*
inputs
):
return
C
.
grad_by_list
(
self
.
net
,
self
.
weights
)(
*
inputs
)
return
grad_by_list
(
self
.
net
,
self
.
weights
)(
*
inputs
)
if_net
=
MyIfByIfNet
()
net
=
GradNet
(
if_net
)
...
...
@@ -634,7 +637,7 @@ def test_if_by_if_return_inside_grad():
@
ms_function
def
construct
(
self
,
*
inputs
):
return
C
.
grad_by_list
(
self
.
net
,
self
.
weights
)(
*
inputs
)
return
grad_by_list
(
self
.
net
,
self
.
weights
)(
*
inputs
)
if_net
=
MyIfByIfNet
()
net
=
GradNet
(
if_net
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录