Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
a61580dc
提交
a61580dc
authored
8月 14, 2015
作者:
Iban Harlouchet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
numpydoc for theano/compile/monitormode.py
上级
cdddc7da
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
22 行增加
和
22 行删除
+22
-22
monitormode.py
theano/compile/monitormode.py
+22
-22
没有找到文件。
theano/compile/monitormode.py
浏览文件 @
a61580dc
...
@@ -8,7 +8,6 @@ from theano.compile.mode import Mode
...
@@ -8,7 +8,6 @@ from theano.compile.mode import Mode
class
MonitorMode
(
Mode
):
class
MonitorMode
(
Mode
):
"""
"""
`MonitorMode` is a debug mode to easily step through function execution.
`MonitorMode` is a debug mode to easily step through function execution.
...
@@ -19,28 +18,28 @@ class MonitorMode(Mode):
...
@@ -19,28 +18,28 @@ class MonitorMode(Mode):
A typical use case is to detect the introduction of NaN values in a graph.
A typical use case is to detect the introduction of NaN values in a graph.
For an example of such a use case, see doc/tutorial/debug_faq.txt.
For an example of such a use case, see doc/tutorial/debug_faq.txt.
Parameters
----------
pre_func
A function to call before executing a thunk, with arguments:
- the thunk index
- the Apply node
- the thunk to be called
post_func
A function to call after executing a thunk, with the same three
arguments as `pre_func`.
optimizer
The optimizer to use. One may use for instance 'fast_compile' to skip
optimizations.
linker
DO NOT USE. This mode uses its own linker. The parameter is needed to
allow selecting optimizers to use.
"""
"""
def
__init__
(
self
,
pre_func
=
None
,
post_func
=
None
,
def
__init__
(
self
,
pre_func
=
None
,
post_func
=
None
,
optimizer
=
'default'
,
linker
=
None
):
optimizer
=
'default'
,
linker
=
None
):
"""
Constructor.
:param pre_func: A function to call before executing a thunk, with
arguments:
- the thunk index
- the Apply node
- the thunk to be called
:param post_func: A function to call after executing a thunk, with the
same three arguments as `pre_func`.
:param optimizer: The optimizer to use. One may use for instance
'fast_compile' to skip optimizations.
:param linker: DO NOT USE. This mode uses its own linker.
The parameter is needed to allow selecting optimizers to use.
"""
self
.
pre_func
=
pre_func
self
.
pre_func
=
pre_func
self
.
post_func
=
post_func
self
.
post_func
=
post_func
wrap_linker
=
theano
.
gof
.
WrapLinkerMany
([
theano
.
gof
.
OpWiseCLinker
()],
wrap_linker
=
theano
.
gof
.
WrapLinkerMany
([
theano
.
gof
.
OpWiseCLinker
()],
...
@@ -67,6 +66,7 @@ class MonitorMode(Mode):
...
@@ -67,6 +66,7 @@ class MonitorMode(Mode):
def
eval
(
self
,
i
,
node
,
fn
):
def
eval
(
self
,
i
,
node
,
fn
):
"""
"""
The method that calls the thunk `fn`.
The method that calls the thunk `fn`.
"""
"""
if
self
.
pre_func
is
not
None
:
if
self
.
pre_func
is
not
None
:
self
.
pre_func
(
i
,
node
,
fn
)
self
.
pre_func
(
i
,
node
,
fn
)
...
@@ -96,9 +96,9 @@ class MonitorMode(Mode):
...
@@ -96,9 +96,9 @@ class MonitorMode(Mode):
"""
"""
Create a new instance of this Mode.
Create a new instance of this Mode.
Keyword arguments can be provided for the linker,
Keyword arguments can be provided for the linker,
but they will be
but they will be ignored, because ProfileMode needs
ignored, because ProfileMode needs to use its own linker.
to use its own linker.
"""
"""
new_mode
=
type
(
self
)(
pre_func
=
self
.
pre_func
,
new_mode
=
type
(
self
)(
pre_func
=
self
.
pre_func
,
post_func
=
self
.
post_func
,
post_func
=
self
.
post_func
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论