Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
9ccbda50
提交
9ccbda50
authored
7月 22, 2015
作者:
Frédéric Bastien
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3066 from t13m/debug_flag_print_rejected_optimizations
Debug flag print rejected optimizations when validate fails
上级
669cf0d1
d5b1d266
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
24 行增加
和
2 行删除
+24
-2
configdefaults.py
theano/configdefaults.py
+0
-1
toolbox.py
theano/gof/toolbox.py
+24
-1
没有找到文件。
theano/configdefaults.py
浏览文件 @
9ccbda50
...
@@ -538,7 +538,6 @@ AddConfigVar(
...
@@ -538,7 +538,6 @@ AddConfigVar(
BoolParam
(
True
,
allow_override
=
True
),
BoolParam
(
True
,
allow_override
=
True
),
in_c_key
=
False
)
in_c_key
=
False
)
"""Note to developers:
"""Note to developers:
Generally your exceptions should use an apply node's __str__
Generally your exceptions should use an apply node's __str__
method when exception_verbosity == 'low'. When exception_verbosity
method when exception_verbosity == 'low'. When exception_verbosity
...
...
theano/gof/toolbox.py
浏览文件 @
9ccbda50
...
@@ -2,6 +2,7 @@ from __future__ import print_function
...
@@ -2,6 +2,7 @@ from __future__ import print_function
from
functools
import
partial
from
functools
import
partial
import
sys
import
sys
import
time
import
time
import
inspect
import
theano
import
theano
from
theano
import
config
from
theano
import
config
...
@@ -200,7 +201,27 @@ class Validator(Feature):
...
@@ -200,7 +201,27 @@ class Validator(Feature):
def
validate_
(
self
,
fgraph
):
def
validate_
(
self
,
fgraph
):
t0
=
time
.
time
()
t0
=
time
.
time
()
ret
=
fgraph
.
execute_callbacks
(
'validate'
)
try
:
ret
=
fgraph
.
execute_callbacks
(
'validate'
)
except
Exception
as
e
:
cf
=
inspect
.
currentframe
()
uf
=
cf
.
f_back
uf_info
=
inspect
.
getframeinfo
(
uf
)
# If the caller is replace_all_validate, just raise the
# exception. replace_all_validate will print out the
# verbose output.
# Or it has to be done here before raise.
if
uf_info
.
function
==
'replace_all_validate'
:
raise
else
:
verbose
=
uf
.
f_locals
.
get
(
'verbose'
,
False
)
if
verbose
:
r
=
uf
.
f_locals
.
get
(
'r'
,
""
)
reason
=
uf_info
.
function
print
(
"validate failed on node
%
s.
\n
Reason:
%
s,
%
s"
%
(
r
,
reason
,
e
))
raise
t1
=
time
.
time
()
t1
=
time
.
time
()
if
fgraph
.
profile
:
if
fgraph
.
profile
:
fgraph
.
profile
.
validate_time
+=
t1
-
t0
fgraph
.
profile
.
validate_time
+=
t1
-
t0
...
@@ -272,6 +293,8 @@ class ReplaceValidate(History, Validator):
...
@@ -272,6 +293,8 @@ class ReplaceValidate(History, Validator):
fgraph
.
validate
()
fgraph
.
validate
()
except
Exception
as
e
:
except
Exception
as
e
:
fgraph
.
revert
(
chk
)
fgraph
.
revert
(
chk
)
if
verbose
:
print
(
"validate failed on node
%
s.
\n
Reason:
%
s,
%
s"
%
(
r
,
reason
,
e
))
raise
raise
if
verbose
:
if
verbose
:
print
(
reason
,
r
,
new_r
)
print
(
reason
,
r
,
new_r
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论