Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
2815db5b
提交
2815db5b
authored
3月 26, 2009
作者:
James Bergstra
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
small changes to debugmode docs
上级
12d2c60c
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
14 行增加
和
9 行删除
+14
-9
debug_faq.txt
doc/advanced/debug_faq.txt
+3
-2
test_opt.py
theano/gof/tests/test_opt.py
+11
-7
没有找到文件。
doc/advanced/debug_faq.txt
浏览文件 @
2815db5b
...
@@ -8,7 +8,8 @@ Debugging Theano: FAQ and Troubleshooting
...
@@ -8,7 +8,8 @@ Debugging Theano: FAQ and Troubleshooting
There are many kinds of bugs that might come up in a computer program.
There are many kinds of bugs that might come up in a computer program.
This page is structured as an FAQ. It should provide recipes to tackle common
This page is structured as an FAQ. It should provide recipes to tackle common
problems, and introduce some of the tools that we use to find problems in our
problems, and introduce some of the tools that we use to find problems in our
Theano code, and even (it happens) in Theano's internals.
Theano code, and even (it happens) in Theano's internals, such as
:ref:`debugmode`.
...
@@ -18,7 +19,7 @@ How do I print an intermediate value in a Function/Method?
...
@@ -18,7 +19,7 @@ How do I print an intermediate value in a Function/Method?
Theano provides a 'Print' Op to do this.
Theano provides a 'Print' Op to do this.
.. code-block::
.. code-block::
python
x = theano.tensor.dvector('x')
x = theano.tensor.dvector('x')
...
...
theano/gof/tests/test_opt.py
浏览文件 @
2815db5b
...
@@ -382,14 +382,18 @@ class TestEquilibrium(object):
...
@@ -382,14 +382,18 @@ class TestEquilibrium(object):
e
=
op3
(
op4
(
x
,
y
))
e
=
op3
(
op4
(
x
,
y
))
g
=
Env
([
x
,
y
,
z
],
[
e
])
g
=
Env
([
x
,
y
,
z
],
[
e
])
print
'before'
,
g
print
'before'
,
g
oldstderr
=
sys
.
stderr
sys
.
stderr
=
sys
.
stdout
# display pesky warnings along with stdout
sys
.
stderr
=
sys
.
stdout
# display pesky warnings along with stdout
opt
=
EquilibriumOptimizer
(
try
:
[
PatternSub
((
op1
,
'x'
,
'y'
),
(
op2
,
'x'
,
'y'
)),
opt
=
EquilibriumOptimizer
(
PatternSub
((
op4
,
'x'
,
'y'
),
(
op1
,
'x'
,
'y'
)),
[
PatternSub
((
op1
,
'x'
,
'y'
),
(
op2
,
'x'
,
'y'
)),
PatternSub
((
op3
,
(
op2
,
'x'
,
'y'
)),
(
op4
,
'x'
,
'y'
))
PatternSub
((
op4
,
'x'
,
'y'
),
(
op1
,
'x'
,
'y'
)),
],
PatternSub
((
op3
,
(
op2
,
'x'
,
'y'
)),
(
op4
,
'x'
,
'y'
))
max_use_ratio
=
1.
/
len
(
g
.
nodes
))
# each opt can only be applied once
],
opt
.
optimize
(
g
)
max_use_ratio
=
1.
/
len
(
g
.
nodes
))
# each opt can only be applied once
opt
.
optimize
(
g
)
finally
:
sys
.
stderr
=
oldstderr
print
'after'
,
g
print
'after'
,
g
assert
str
(
g
)
==
'[Op4(x, y)]'
assert
str
(
g
)
==
'[Op4(x, y)]'
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论