Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
712ddb14
提交
712ddb14
authored
10月 16, 2015
作者:
carriepl
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix debugprint tests for graphs
上级
65550f01
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
183 行增加
和
188 行删除
+183
-188
test_printing.py
theano/tests/test_printing.py
+183
-188
没有找到文件。
theano/tests/test_printing.py
浏览文件 @
712ddb14
...
...
@@ -271,36 +271,35 @@ def test_scan_debugprint1():
| |for{cpu,scan_fn} [@C] ''
| | |k [@D]
| | |IncSubtensor{Set;:int64:} [@E] ''
| | | |Alloc [@F] ''
| | | | |TensorConstant{0.0} [@G]
| | | | |Elemwise{add,no_inplace} [@H] ''
| | | |AllocEmpty{dtype='float64'} [@F] ''
| | | | |Elemwise{add,no_inplace} [@G] ''
| | | | | |k [@D]
| | | | | |Subtensor{int64} [@
I
] ''
| | | | | |Shape [@
J
] ''
| | | | | | |Rebroadcast{0} [@
K
] ''
| | | | | | |DimShuffle{x,0} [@
L
] ''
| | | | | | |Elemwise{second,no_inplace} [@
M
] ''
| | | | | | |A [@
N
]
| | | | | | |DimShuffle{x} [@
O
] ''
| | | | | | |TensorConstant{1.0} [@
P
]
| | | | | |Constant{0} [@
Q
]
| | | | |Subtensor{int64} [@
R
] ''
| | | | |Shape [@
S
] ''
| | | | | |Rebroadcast{0} [@
K
] ''
| | | | |Constant{1} [@
T
]
| | | |Rebroadcast{0} [@
K
] ''
| | | |ScalarFromTensor [@
U
] ''
| | | |Subtensor{int64} [@
I
] ''
| | |A [@
N
]
| |Constant{1} [@
V
]
|Constant{-1} [@
W
]
| | | | | |Subtensor{int64} [@
H
] ''
| | | | | |Shape [@
I
] ''
| | | | | | |Rebroadcast{0} [@
J
] ''
| | | | | | |DimShuffle{x,0} [@
K
] ''
| | | | | | |Elemwise{second,no_inplace} [@
L
] ''
| | | | | | |A [@
M
]
| | | | | | |DimShuffle{x} [@
N
] ''
| | | | | | |TensorConstant{1.0} [@
O
]
| | | | | |Constant{0} [@
P
]
| | | | |Subtensor{int64} [@
Q
] ''
| | | | |Shape [@
R
] ''
| | | | | |Rebroadcast{0} [@
J
] ''
| | | | |Constant{1} [@
S
]
| | | |Rebroadcast{0} [@
J
] ''
| | | |ScalarFromTensor [@
T
] ''
| | | |Subtensor{int64} [@
H
] ''
| | |A [@
M
]
| |Constant{1} [@
U
]
|Constant{-1} [@
V
]
Inner graphs of the scan ops:
for{cpu,scan_fn} [@C] ''
>Elemwise{mul,no_inplace} [@
X
] ''
> |<TensorType(float64, vector)> [@
Y
] -> [@E]
> |A_copy [@
Z] -> [@N
]"""
>Elemwise{mul,no_inplace} [@
W
] ''
> |<TensorType(float64, vector)> [@
X
] -> [@E]
> |A_copy [@
Y] -> [@M
]"""
for
truth
,
out
in
zip
(
expected_output
.
split
(
"
\n
"
),
lines
):
assert
truth
.
strip
()
==
out
.
strip
()
...
...
@@ -455,36 +454,35 @@ def test_scan_debugprint3():
> | | |for{cpu,scan_fn} [@BE] ''
> | | | |k_copy [@BF] -> [@X]
> | | | |IncSubtensor{Set;:int64:} [@BG] ''
> | | | | |Alloc [@BH] ''
> | | | | | |TensorConstant{0.0} [@BI]
> | | | | | |Elemwise{add,no_inplace} [@BJ] ''
> | | | | |AllocEmpty{dtype='float64'} [@BH] ''
> | | | | | |Elemwise{add,no_inplace} [@BI] ''
> | | | | | | |k_copy [@BF] -> [@X]
> | | | | | | |Subtensor{int64} [@B
K
] ''
> | | | | | | |Shape [@B
L
] ''
> | | | | | | | |Rebroadcast{0} [@B
M
] ''
> | | | | | | | |DimShuffle{x,0} [@B
N
] ''
> | | | | | | | |Elemwise{second,no_inplace} [@B
O
] ''
> | | | | | | | |A_copy [@B
P
] -> [@W]
> | | | | | | | |DimShuffle{x} [@B
Q
] ''
> | | | | | | | |TensorConstant{1.0} [@B
R
]
> | | | | | | |Constant{0} [@B
S
]
> | | | | | |Subtensor{int64} [@B
T
] ''
> | | | | | |Shape [@B
U
] ''
> | | | | | | |Rebroadcast{0} [@B
M
] ''
> | | | | | |Constant{1} [@B
V
]
> | | | | |Rebroadcast{0} [@B
M
] ''
> | | | | |ScalarFromTensor [@B
W
] ''
> | | | | |Subtensor{int64} [@B
K
] ''
> | | | |A_copy [@B
P
] -> [@W]
> | | |Constant{1} [@B
X
]
> | |Constant{-1} [@B
Y
]
> |DimShuffle{x} [@B
Z
] ''
> |<TensorType(int64, scalar)> [@
CA
] -> [@U]
> | | | | | | |Subtensor{int64} [@B
J
] ''
> | | | | | | |Shape [@B
K
] ''
> | | | | | | | |Rebroadcast{0} [@B
L
] ''
> | | | | | | | |DimShuffle{x,0} [@B
M
] ''
> | | | | | | | |Elemwise{second,no_inplace} [@B
N
] ''
> | | | | | | | |A_copy [@B
O
] -> [@W]
> | | | | | | | |DimShuffle{x} [@B
P
] ''
> | | | | | | | |TensorConstant{1.0} [@B
Q
]
> | | | | | | |Constant{0} [@B
R
]
> | | | | | |Subtensor{int64} [@B
S
] ''
> | | | | | |Shape [@B
T
] ''
> | | | | | | |Rebroadcast{0} [@B
L
] ''
> | | | | | |Constant{1} [@B
U
]
> | | | | |Rebroadcast{0} [@B
L
] ''
> | | | | |ScalarFromTensor [@B
V
] ''
> | | | | |Subtensor{int64} [@B
J
] ''
> | | | |A_copy [@B
O
] -> [@W]
> | | |Constant{1} [@B
W
]
> | |Constant{-1} [@B
X
]
> |DimShuffle{x} [@B
Y
] ''
> |<TensorType(int64, scalar)> [@
BZ
] -> [@U]
for{cpu,scan_fn} [@BE] ''
>Elemwise{mul,no_inplace} [@C
B
] ''
> |<TensorType(float64, vector)> [@C
C
] -> [@BG]
> |A_copy [@C
D] -> [@BP
]"""
>Elemwise{mul,no_inplace} [@C
A
] ''
> |<TensorType(float64, vector)> [@C
B
] -> [@BG]
> |A_copy [@C
C] -> [@BO
]"""
for
truth
,
out
in
zip
(
expected_output
.
split
(
"
\n
"
),
lines
):
assert
truth
.
strip
()
==
out
.
strip
()
...
...
@@ -514,51 +512,49 @@ def test_scan_debugprint4():
| |for{cpu,scan_fn}.0 [@C] ''
| | |TensorConstant{5} [@D]
| | |IncSubtensor{Set;:int64:} [@E] ''
| | | |Alloc [@F] ''
| | | | |TensorConstant{0} [@G]
| | | | |Elemwise{add,no_inplace} [@H] ''
| | | |AllocEmpty [@F] ''
| | | | |Elemwise{add,no_inplace} [@G] ''
| | | | |TensorConstant{5} [@D]
| | | | |Subtensor{int64} [@
I
] ''
| | | | |Shape [@
J
] ''
| | | | | |Subtensor{:int64:} [@
K
] ''
| | | | | |<TensorType(int64, vector)> [@
L
]
| | | | | |Constant{2} [@
M
]
| | | | |Constant{0} [@
N
]
| | | | |Subtensor{int64} [@
H
] ''
| | | | |Shape [@
I
] ''
| | | | | |Subtensor{:int64:} [@
J
] ''
| | | | | |<TensorType(int64, vector)> [@
K
]
| | | | | |Constant{2} [@
L
]
| | | | |Constant{0} [@
M
]
| | | |Subtensor{:int64:} [@K] ''
| | | |ScalarFromTensor [@O] ''
| | | |Subtensor{int64} [@I] ''
| | |IncSubtensor{Set;:int64:} [@P] ''
| | |Alloc [@Q] ''
| | | |TensorConstant{0} [@G]
| | | |Elemwise{add,no_inplace} [@R] ''
| | | |ScalarFromTensor [@N] ''
| | | |Subtensor{int64} [@H] ''
| | |IncSubtensor{Set;:int64:} [@O] ''
| | |AllocEmpty [@P] ''
| | | |Elemwise{add,no_inplace} [@Q] ''
| | | |TensorConstant{5} [@D]
| | | |Subtensor{int64} [@
S
] ''
| | | |Shape [@
T
] ''
| | | | |Subtensor{:int64:} [@
U
] ''
| | | | |<TensorType(int64, vector)> [@
V
]
| | | | |Constant{2} [@
W
]
| | | |Constant{0} [@
X
]
| | |Subtensor{:int64:} [@
U
] ''
| | |ScalarFromTensor [@
Y
] ''
| | |Subtensor{int64} [@
S
] ''
| |Constant{2} [@
Z
]
|Subtensor{int64::} [@
BA
] ''
| | | |Subtensor{int64} [@
R
] ''
| | | |Shape [@
S
] ''
| | | | |Subtensor{:int64:} [@
T
] ''
| | | | |<TensorType(int64, vector)> [@
U
]
| | | | |Constant{2} [@
V
]
| | | |Constant{0} [@
W
]
| | |Subtensor{:int64:} [@
T
] ''
| | |ScalarFromTensor [@
X
] ''
| | |Subtensor{int64} [@
R
] ''
| |Constant{2} [@
Y
]
|Subtensor{int64::} [@
Z
] ''
|for{cpu,scan_fn}.1 [@C] ''
|Constant{2} [@B
B
]
|Constant{2} [@B
A
]
Inner graphs of the scan ops:
for{cpu,scan_fn}.0 [@C] ''
>Elemwise{add,no_inplace} [@BC] ''
>Elemwise{add,no_inplace} [@BB] ''
> |<TensorType(int64, scalar)> [@BC] -> [@E]
> |<TensorType(int64, scalar)> [@BD] -> [@E]
> |<TensorType(int64, scalar)> [@BE] -> [@E]
>Elemwise{add,no_inplace} [@BF] ''
> |<TensorType(int64, scalar)> [@BF] -> [@P]
> |<TensorType(int64, scalar)> [@BG] -> [@P]
> |<TensorType(int64, scalar)> [@BH] -> [@P]
for{cpu,scan_fn}.1 [@C] ''
>Elemwise{add,no_inplace} [@B
C
] ''
>Elemwise{add,no_inplace} [@B
F
] ''"""
>Elemwise{add,no_inplace} [@B
B
] ''
>Elemwise{add,no_inplace} [@B
E
] ''"""
for
truth
,
out
in
zip
(
expected_output
.
split
(
"
\n
"
),
lines
):
assert
truth
.
strip
()
==
out
.
strip
()
...
...
@@ -583,122 +579,121 @@ def test_scan_debugprint5():
lines
+=
[
line
]
expected_output
=
"""Subtensor{int64} [@A] ''
|for{cpu,grad_of_scan_fn}.1 [@B] ''
| |Elemwise{sub,no_inplace} [@C] ''
| | |Subtensor{int64} [@D] ''
| | | |Shape [@E] ''
| | | | |for{cpu,scan_fn} [@F] ''
| | | | |k [@G]
| | | | |IncSubtensor{Set;:int64:} [@H] ''
| | | | | |Alloc [@I] ''
| | | | | | |TensorConstant{0.0} [@J]
| | | | | | |Elemwise{add,no_inplace} [@K] ''
| | | | | | | |k [@G]
| | | | | | | |Subtensor{int64} [@L] ''
| | | | | | | |Shape [@M] ''
| | | | | | | | |Rebroadcast{0} [@N] ''
| | | | | | | | |DimShuffle{x,0} [@O] ''
| | | | | | | | |Elemwise{second,no_inplace} [@P] ''
| | | | | | | | |A [@Q]
| | | | | | | | |DimShuffle{x} [@R] ''
| | | | | | | | |TensorConstant{1.0} [@S]
| | | | | | | |Constant{0} [@T]
| | | | | | |Subtensor{int64} [@U] ''
| | | | | | |Shape [@V] ''
| | | | | | | |Rebroadcast{0} [@N] ''
| | | | | | |Constant{1} [@W]
| | | | | |Rebroadcast{0} [@N] ''
| | | | | |ScalarFromTensor [@X] ''
| | | | | |Subtensor{int64} [@L] ''
| | | | |A [@Q]
| | | |Constant{0} [@Y]
| | |TensorConstant{1} [@Z]
| |Subtensor{:int64:} [@BA] ''
| | |Subtensor{::int64} [@BB] ''
| | | |Subtensor{:int64:} [@BC] ''
| | | | |for{cpu,scan_fn} [@F] ''
| | | | |Constant{-1} [@BD]
| | | |Constant{-1} [@BE]
| | |ScalarFromTensor [@BF] ''
| | |Elemwise{sub,no_inplace} [@C] ''
| |Subtensor{:int64:} [@BG] ''
| | |Subtensor{:int64:} [@BH] ''
| | | |Subtensor{::int64} [@BI] ''
| | | | |for{cpu,scan_fn} [@F] ''
| | | | |Constant{-1} [@BJ]
| | | |Constant{-1} [@BK]
| | |ScalarFromTensor [@BL] ''
| | |Elemwise{sub,no_inplace} [@C] ''
| |Subtensor{::int64} [@BM] ''
| | |IncSubtensor{Inc;int64::} [@BN] ''
| | | |Elemwise{second,no_inplace} [@BO] ''
| | | | |for{cpu,scan_fn} [@BP] ''
| | | | | |k [@G]
| | | | | |IncSubtensor{Set;:int64:} [@H] ''
| | | | | |A [@Q]
| | | | |DimShuffle{x,x} [@BQ] ''
| | | | |TensorConstant{0.0} [@J]
| | | |IncSubtensor{Inc;int64} [@BR] ''
| | | | |Elemwise{second,no_inplace} [@BS] ''
| | | | | |Subtensor{int64::} [@BT] ''
| | | | | | |for{cpu,scan_fn} [@BP] ''
| | | | | | |Constant{1} [@BU]
| | | | | |DimShuffle{x,x} [@BV] ''
| | | | | |TensorConstant{0.0} [@J]
| | | | |Elemwise{second} [@BW] ''
| | | | | |Subtensor{int64} [@BX] ''
| | | | | | |Subtensor{int64::} [@BT] ''
| | | | | | |Constant{-1} [@BY]
| | | | | |DimShuffle{x} [@BZ] ''
| | | | | |Elemwise{second,no_inplace} [@CA] ''
| | | | | |Sum{acc_dtype=float64} [@CB] ''
| | | | | | |Subtensor{int64} [@BX] ''
| | | | | |TensorConstant{1.0} [@S]
| | | | |Constant{-1} [@BY]
| | | |Constant{1} [@BU]
| | |Constant{-1} [@CC]
| |Alloc [@CD] ''
| | |TensorConstant{0.0} [@J]
| | |Elemwise{add,no_inplace} [@CE] ''
| | | |Elemwise{sub,no_inplace} [@C] ''
| | | |TensorConstant{1} [@Z]
| | |Subtensor{int64} [@CF] ''
| | |Shape [@CG] ''
| | | |A [@Q]
| | |Constant{0} [@CH]
| |A [@Q]
|Constant{-1} [@CI]
|for{cpu,grad_of_scan_fn}.1 [@B] ''
| |Elemwise{sub,no_inplace} [@C] ''
| | |Subtensor{int64} [@D] ''
| | | |Shape [@E] ''
| | | | |for{cpu,scan_fn} [@F] ''
| | | | |k [@G]
| | | | |IncSubtensor{Set;:int64:} [@H] ''
| | | | | |AllocEmpty{dtype='float64'} [@I] ''
| | | | | | |Elemwise{add,no_inplace} [@J] ''
| | | | | | | |k [@G]
| | | | | | | |Subtensor{int64} [@K] ''
| | | | | | | |Shape [@L] ''
| | | | | | | | |Rebroadcast{0} [@M] ''
| | | | | | | | |DimShuffle{x,0} [@N] ''
| | | | | | | | |Elemwise{second,no_inplace} [@O] ''
| | | | | | | | |A [@P]
| | | | | | | | |DimShuffle{x} [@Q] ''
| | | | | | | | |TensorConstant{1.0} [@R]
| | | | | | | |Constant{0} [@S]
| | | | | | |Subtensor{int64} [@T] ''
| | | | | | |Shape [@U] ''
| | | | | | | |Rebroadcast{0} [@M] ''
| | | | | | |Constant{1} [@V]
| | | | | |Rebroadcast{0} [@M] ''
| | | | | |ScalarFromTensor [@W] ''
| | | | | |Subtensor{int64} [@K] ''
| | | | |A [@P]
| | | |Constant{0} [@X]
| | |TensorConstant{1} [@Y]
| |Subtensor{:int64:} [@Z] ''
| | |Subtensor{::int64} [@BA] ''
| | | |Subtensor{:int64:} [@BB] ''
| | | | |for{cpu,scan_fn} [@F] ''
| | | | |Constant{-1} [@BC]
| | | |Constant{-1} [@BD]
| | |ScalarFromTensor [@BE] ''
| | |Elemwise{sub,no_inplace} [@C] ''
| |Subtensor{:int64:} [@BF] ''
| | |Subtensor{:int64:} [@BG] ''
| | | |Subtensor{::int64} [@BH] ''
| | | | |for{cpu,scan_fn} [@F] ''
| | | | |Constant{-1} [@BI]
| | | |Constant{-1} [@BJ]
| | |ScalarFromTensor [@BK] ''
| | |Elemwise{sub,no_inplace} [@C] ''
| |Subtensor{::int64} [@BL] ''
| | |IncSubtensor{Inc;int64::} [@BM] ''
| | | |Elemwise{second,no_inplace} [@BN] ''
| | | | |for{cpu,scan_fn} [@BO] ''
| | | | | |k [@G]
| | | | | |IncSubtensor{Set;:int64:} [@H] ''
| | | | | |A [@P]
| | | | |DimShuffle{x,x} [@BP] ''
| | | | |TensorConstant{0.0} [@BQ]
| | | |IncSubtensor{Inc;int64} [@BR] ''
| | | | |Elemwise{second,no_inplace} [@BS] ''
| | | | | |Subtensor{int64::} [@BT] ''
| | | | | | |for{cpu,scan_fn} [@BO] ''
| | | | | | |Constant{1} [@BU]
| | | | | |DimShuffle{x,x} [@BV] ''
| | | | | |TensorConstant{0.0} [@BQ]
| | | | |Elemwise{second} [@BW] ''
| | | | | |Subtensor{int64} [@BX] ''
| | | | | | |Subtensor{int64::} [@BT] ''
| | | | | | |Constant{-1} [@BY]
| | | | | |DimShuffle{x} [@BZ] ''
| | | | | |Elemwise{second,no_inplace} [@CA] ''
| | | | | |Sum{acc_dtype=float64} [@CB] ''
| | | | | | |Subtensor{int64} [@BX] ''
| | | | | |TensorConstant{1.0} [@R]
| | | | |Constant{-1} [@BY]
| | | |Constant{1} [@BU]
| | |Constant{-1} [@CC]
| |Alloc [@CD] ''
| | |TensorConstant{0.0} [@BQ]
| | |Elemwise{add,no_inplace} [@CE] ''
| | | |Elemwise{sub,no_inplace} [@C] ''
| | | |TensorConstant{1} [@Y]
| | |Subtensor{int64} [@CF] ''
| | |Shape [@CG] ''
| | | |A [@P]
| | |Constant{0} [@CH]
| |A [@P]
|Constant{-1} [@CI]
Inner graphs of the scan ops:
for{cpu,grad_of_scan_fn}.1 [@B] ''
>Elemwise{add,no_inplace} [@CJ] ''
> |Elemwise{mul} [@CK] ''
> | |<TensorType(float64, vector)> [@CL] -> [@BM
]
> | |A_copy [@CM] -> [@Q
]
> |<TensorType(float64, vector)> [@CN] -> [@BM
]
>Elemwise{add,no_inplace} [@CO] ''
> |Elemwise{mul} [@CP] ''
> | |<TensorType(float64, vector)> [@CL] -> [@BM
]
> | |<TensorType(float64, vector)> [@CQ] -> [@BA
]
> |<TensorType(float64, vector)> [@CR] -> [@CD]
>Elemwise{add,no_inplace} [@CJ] ''
> |Elemwise{mul} [@CK] ''
> | |<TensorType(float64, vector)> [@CL] -> [@BL
]
> | |A_copy [@CM] -> [@P
]
> |<TensorType(float64, vector)> [@CN] -> [@BL
]
>Elemwise{add,no_inplace} [@CO] ''
> |Elemwise{mul} [@CP] ''
> | |<TensorType(float64, vector)> [@CL] -> [@BL
]
> | |<TensorType(float64, vector)> [@CQ] -> [@Z
]
> |<TensorType(float64, vector)> [@CR] -> [@CD]
for{cpu,scan_fn} [@F] ''
>Elemwise{mul,no_inplace} [@CS] ''
> |<TensorType(float64, vector)> [@CT] -> [@H]
> |A_copy [@CU] -> [@Q
]
>Elemwise{mul,no_inplace} [@CS] ''
> |<TensorType(float64, vector)> [@CT] -> [@H]
> |A_copy [@CU] -> [@P
]
for{cpu,scan_fn} [@F] ''
>Elemwise{mul,no_inplace} [@CS] ''
>Elemwise{mul,no_inplace} [@CS] ''
for{cpu,scan_fn} [@F] ''
>Elemwise{mul,no_inplace} [@CS] ''
>Elemwise{mul,no_inplace} [@CS] ''
for{cpu,scan_fn} [@B
P
] ''
>Elemwise{mul,no_inplace} [@CS] ''
for{cpu,scan_fn} [@B
O
] ''
>Elemwise{mul,no_inplace} [@CS] ''
for{cpu,scan_fn} [@B
P
] ''
>Elemwise{mul,no_inplace} [@CS] ''"""
for{cpu,scan_fn} [@B
O
] ''
>Elemwise{mul,no_inplace} [@CS] ''"""
for
truth
,
out
in
zip
(
expected_output
.
split
(
"
\n
"
),
lines
):
assert
truth
.
strip
()
==
out
.
strip
()
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论