Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
be939078
提交
be939078
authored
11月 04, 2015
作者:
Francesco Visin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add print_test_value_by_default option
Add option to print the tag.test_value with the variable name by default.
上级
30cc6380
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
28 行增加
和
2 行删除
+28
-2
debugmode.py
theano/compile/debugmode.py
+2
-2
configdefaults.py
theano/configdefaults.py
+8
-0
graph.py
theano/gof/graph.py
+18
-0
没有找到文件。
theano/compile/debugmode.py
浏览文件 @
be939078
...
@@ -764,7 +764,7 @@ def debugprint(r, prefix='', depth=-1, done=None, print_type=False,
...
@@ -764,7 +764,7 @@ def debugprint(r, prefix='', depth=-1, done=None, print_type=False,
outer_id_str
=
get_id_str
(
outer_r
.
owner
)
outer_id_str
=
get_id_str
(
outer_r
.
owner
)
else
:
else
:
outer_id_str
=
get_id_str
(
outer_r
)
outer_id_str
=
get_id_str
(
outer_r
)
print
(
'
%
s
%
s
%
s
%
s ->
%
s'
%
(
prefix
,
r
,
id_str
,
type_str
,
print
(
'
%
s
%
s
%
s
%
s ->
%
s'
%
(
prefix
,
r
.
__str_name__
()
,
id_str
,
type_str
,
outer_id_str
),
file
=
file
)
outer_id_str
),
file
=
file
)
else
:
else
:
# this is an input variable
# this is an input variable
...
@@ -772,7 +772,7 @@ def debugprint(r, prefix='', depth=-1, done=None, print_type=False,
...
@@ -772,7 +772,7 @@ def debugprint(r, prefix='', depth=-1, done=None, print_type=False,
if
smap
:
if
smap
:
data
=
" "
+
str
(
smap
.
get
(
r
,
''
))
data
=
" "
+
str
(
smap
.
get
(
r
,
''
))
id_str
=
get_id_str
(
r
)
id_str
=
get_id_str
(
r
)
print
(
'
%
s
%
s
%
s
%
s
%
s'
%
(
prefix
,
r
,
id_str
,
print
(
'
%
s
%
s
%
s
%
s
%
s'
%
(
prefix
,
r
.
__str_name__
()
,
id_str
,
type_str
,
data
),
type_str
,
data
),
file
=
file
)
file
=
file
)
...
...
theano/configdefaults.py
浏览文件 @
be939078
...
@@ -644,6 +644,14 @@ AddConfigVar(
...
@@ -644,6 +644,14 @@ AddConfigVar(
in_c_key
=
False
)
in_c_key
=
False
)
AddConfigVar
(
'print_test_value_by_default'
,
(
"If 'True', Theano will override the '__str__' method of its "
"variables to also print the tag.test_value when this is available."
),
BoolParam
(
False
),
in_c_key
=
False
)
AddConfigVar
(
'compute_test_value_opt'
,
AddConfigVar
(
'compute_test_value_opt'
,
(
"For debugging Theano optimization only."
(
"For debugging Theano optimization only."
" Same as compute_test_value, but is used"
" Same as compute_test_value, but is used"
...
...
theano/gof/graph.py
浏览文件 @
be939078
...
@@ -12,6 +12,7 @@ from copy import copy
...
@@ -12,6 +12,7 @@ from copy import copy
from
itertools
import
count
from
itertools
import
count
import
theano
import
theano
from
theano
import
config
from
theano.gof
import
utils
from
theano.gof
import
utils
from
six
import
string_types
,
integer_types
,
iteritems
from
six
import
string_types
,
integer_types
,
iteritems
from
theano.misc.ordered_set
import
OrderedSet
from
theano.misc.ordered_set
import
OrderedSet
...
@@ -394,6 +395,17 @@ class Variable(Node):
...
@@ -394,6 +395,17 @@ class Variable(Node):
"""
"""
WRITEME
WRITEME
"""
if
config
.
print_test_value_by_default
:
if
self
.
__get_test_value__
()
is
not
None
:
return
'
\n
'
.
join
([
self
.
__str_name__
(),
self
.
__get_test_value__
()])
return
self
.
__str_name__
()
def
__str_name__
(
self
):
"""
WRITEME
"""
"""
if
self
.
name
is
not
None
:
if
self
.
name
is
not
None
:
return
self
.
name
return
self
.
name
...
@@ -406,6 +418,12 @@ class Variable(Node):
...
@@ -406,6 +418,12 @@ class Variable(Node):
else
:
else
:
return
"<
%
s>"
%
str
(
self
.
type
)
return
"<
%
s>"
%
str
(
self
.
type
)
def
__get_test_value__
(
self
):
try
:
return
repr
(
self
.
tag
.
test_value
)
except
AttributeError
:
return
None
def
__repr__
(
self
):
def
__repr__
(
self
):
return
str
(
self
)
return
str
(
self
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论