Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
92b60da5
提交
92b60da5
authored
4月 13, 2017
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Better error message and simplicy code,doc.
上级
401cdef9
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
10 行增加
和
5 行删除
+10
-5
configparser.py
theano/configparser.py
+1
-1
fg.py
theano/gof/fg.py
+2
-1
toolbox.py
theano/gof/toolbox.py
+7
-3
没有找到文件。
theano/configparser.py
浏览文件 @
92b60da5
...
...
@@ -105,7 +105,7 @@ class change_flags(object):
for
k
in
args
:
l
=
[
v
for
v
in
theano
.
configparser
.
_config_var_list
if
v
.
fullname
==
k
]
assert
len
(
l
)
==
1
assert
len
(
l
)
==
1
,
l
confs
[
k
]
=
l
[
0
]
self
.
confs
=
confs
self
.
new_vals
=
args
...
...
theano/gof/fg.py
浏览文件 @
92b60da5
...
...
@@ -482,7 +482,8 @@ class FunctionGraph(utils.object2):
print_type
=
True
,
used_ids
=
used_ids
)
.
getvalue
()
raise
toolbox
.
BadOptimization
(
r
,
new_r
,
None
,
None
,
reason
,
old
,
new
)
r
,
new_r
,
None
,
None
,
str
(
reason
)
+
". The type of the replacement must be the same."
,
old
,
new
)
new_r
=
new_r2
if
r
not
in
self
.
variables
:
# this variable isn't in the graph... don't raise an
...
...
theano/gof/toolbox.py
浏览文件 @
92b60da5
...
...
@@ -41,7 +41,8 @@ class BadOptimization(Exception):
Exception: some variable and its substitute take different runtime values.
Note: If there is only 1 parameter and it is a string, we will use
it as the error message.
it as the error message. This is needed when we catch, extend and
reraise an error.
"""
...
...
@@ -103,6 +104,8 @@ class BadOptimization(Exception):
self
.
reason
=
reason
self
.
old_graph
=
old_graph
self
.
new_graph
=
new_graph
# To allow extending the error message of an existing error.
self
.
full_err
=
None
if
isinstance
(
old_r
,
str
):
assert
(
new_r
is
None
and
old_r_val
is
None
and
new_r_val
is
None
and
...
...
@@ -110,8 +113,6 @@ class BadOptimization(Exception):
self
.
full_err
=
old_r
def
__str__
(
self
):
if
getattr
(
self
,
'full_err'
,
None
)
is
not
None
:
return
self
.
full_err
return
self
.
str_diagnostic
()
def
str_diagnostic
(
self
):
...
...
@@ -120,6 +121,9 @@ class BadOptimization(Exception):
of the exception.
"""
# We have a pre-made message
if
getattr
(
self
,
'full_err'
,
None
)
is
not
None
:
return
self
.
full_err
sio
=
StringIO
()
val_str_len_limit
=
800
print
(
"BadOptimization Error"
,
super
(
BadOptimization
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论