Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
f0f426ce
提交
f0f426ce
authored
3月 26, 2009
作者:
James Bergstra
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixing links in debugmode docs
上级
cb315e22
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
24 行增加
和
15 行删除
+24
-15
debug_faq.txt
doc/advanced/debug_faq.txt
+3
-3
debugmode.txt
doc/advanced/debugmode.txt
+5
-5
profilemode.txt
doc/advanced/profilemode.txt
+2
-0
inplace.txt
doc/advanced_tutorial/inplace.txt
+9
-2
debugmode.py
theano/compile/debugmode.py
+4
-4
test_debugmode.py
theano/compile/tests/test_debugmode.py
+1
-1
没有找到文件。
doc/advanced/debug_faq.txt
浏览文件 @
f0f426ce
...
...
@@ -38,12 +38,12 @@ Theano provides a 'Print' Op to do this.
Since Theano runs your program in a topological order, you won't have precise
control over the order in which multiple Print() Ops are evaluted. For a more
precise inspection of what's being computed where, when, and how, see the
:ref:`
wraplinker_faq
`.
:ref:`
faq_wraplinker
`.
.. _
wraplinker_faq
:
.. _
faq_wraplinker
:
How do I step through a compiled function with the WrapLinker?
--------------------------------------------------------------
...
...
@@ -81,7 +81,7 @@ The function I compiled is too slow, what's up?
First, make sure you're running in FAST_RUN mode, by passing ``mode='FAST_RUN'``
to ``theano.function`` or ``theano.make``.
Second, try the theano :ref:`profile
r
`. This will tell you which Apply nodes,
Second, try the theano :ref:`profile
mode
`. This will tell you which Apply nodes,
and which Ops are eating up your CPU cycles.
doc/advanced/debugmode.txt
浏览文件 @
f0f426ce
...
...
@@ -70,14 +70,14 @@ For detailed documentation see :api:`BadOptimization`.
BadDestroyMap
-------------
This happens when an Op's
perform() or c_code()
modifies an input that it wasn't
This happens when an Op's
``perform()`` or ``c_code()``
modifies an input that it wasn't
supposed to. If either the ``perform`` or ``c_code`` implementation of an Op
might modify any input, it has to advertise that fact via the ``destroy_map``
attribute.
For detailed documentation on the Exception see :api:`BadDestroyMap`.
For detailed documentation on the Exception
,
see :api:`BadDestroyMap`.
For detailed documentation on the ``destroy_map`` attribute
:ref:`destroymap
`.
For detailed documentation on the ``destroy_map`` attribute
, see :ref:`_inplace
`.
BadViewMap
...
...
@@ -87,9 +87,9 @@ This happens when an Op's perform() or c_code() creates an alias or alias-like
dependency between an input and an output... and it didn't warn the
optimization system via the ``view_map`` attribute.
For detailed documentation on the Exception see :api:`BadViewMap`.
For detailed documentation on the Exception
,
see :api:`BadViewMap`.
For detailed documentation on the ``view_map`` attribute
:ref:`destroymap
`.
For detailed documentation on the ``view_map`` attribute
, see :ref:`_views
`.
StochasticOrder
...
...
doc/advanced/profilemode.txt
浏览文件 @
f0f426ce
.. _profilemode:
=========================================
ProfileMode
=========================================
...
...
doc/advanced_tutorial/inplace.txt
浏览文件 @
f0f426ce
.. _views_and_inplace:
============================
Views and inplace operations
...
...
@@ -19,6 +20,7 @@ floats are immutable). Therefore, we can't make examples of these
concepts out of what we've just built. Nonetheless, we will present
the concepts:
.. _views:
Views
=====
...
...
@@ -77,6 +79,8 @@ unsupported. Here are more examples:
myop.view_map = {0: [0, 1]} # THIS IS NOT SUPPORTED! Only put a single input number in the list!
.. _inplace:
Inplace operations
==================
...
...
@@ -186,6 +190,9 @@ input(s)'s memory). From there, go to the previous section.
the addition, the original x that we wanted to take the logarithm
of is gone). If Theano does not know that ``add_inplace`` changes
the value of ``x`` it might invert the order and that will
certainly lead to erroneous computations and be a headache to
debug.
certainly lead to erroneous computations.
You can often identify an incorrect view_map or destroy_map by using
:ref:`DebugMode`. *Be sure to use DebugMode when developing a new Op that
uses view_map and/or destroy_map.*
theano/compile/debugmode.py
浏览文件 @
f0f426ce
...
...
@@ -31,7 +31,7 @@ class DebugModeError(Exception):
"""Generic Exception raised to indicate an internal theano problem"""
pass
class
BadC
l
inkerOutput
(
DebugModeError
):
class
BadC
L
inkerOutput
(
DebugModeError
):
"""Exception: an Op's c_code and perform implementations don't agree."""
r
=
None
...
...
@@ -45,7 +45,7 @@ class BadClinkerOutput(DebugModeError):
def
__init__
(
self
,
r
,
val_py
,
val_c
):
"""Initialize members"""
super
(
BadC
l
inkerOutput
,
self
)
.
__init__
()
super
(
BadC
L
inkerOutput
,
self
)
.
__init__
()
self
.
r
=
r
self
.
val_py
=
val_py
self
.
val_c
=
val_c
...
...
@@ -861,7 +861,7 @@ class _Linker(gof.link.LocalLinker):
# compares the version from thunk_py (in r_vals)
# to the version produced by thunk_c (in storage_map)
if
not
r
.
type
.
values_eq_approx
(
r_vals
[
r
],
storage_map
[
r
][
0
]):
raise
BadC
l
inkerOutput
(
r
,
val_py
=
r_vals
[
r
],
val_c
=
storage_map
[
r
][
0
])
raise
BadC
L
inkerOutput
(
r
,
val_py
=
r_vals
[
r
],
val_c
=
storage_map
[
r
][
0
])
else
:
#retrieve each output from the storage_map
r_vals
[
r
]
=
storage_map
[
r
][
0
]
...
...
@@ -1128,7 +1128,7 @@ class DebugMode(Mode):
This mode catches several kinds of internal error:
- inconsistent c_code and perform implementations (see `BadC
l
inkerOutput`)
- inconsistent c_code and perform implementations (see `BadC
L
inkerOutput`)
- a variable replacing another when their runtime values don't match. This is a symptom of
an incorrect optimization step, or faulty Op implementation (raises `BadOptimization`)
...
...
theano/compile/tests/test_debugmode.py
浏览文件 @
f0f426ce
...
...
@@ -268,7 +268,7 @@ def test_badclinkeroutput():
[
0
,
1
,
2
,
3
],
3
,
numpy
.
asarray
([[
0.
,
1.
,
2.
],[
3.
,
4.
,
5.
],[
6.
,
7.
,
8.
]]))
except
debugmode
.
BadC
l
inkerOutput
,
e
:
except
debugmode
.
BadC
L
inkerOutput
,
e
:
print
repr
(
e
)
assert
e
.
r
.
owner
.
op
is
inconsistent
return
#TEST PASS
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论