Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
37bf28f6
提交
37bf28f6
authored
9月 23, 2015
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Allow to do a debugprint of the profiled function
上级
79ce0fba
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
21 行增加
和
2 行删除
+21
-2
config.txt
doc/library/config.txt
+8
-0
profiling.py
theano/compile/profiling.py
+10
-0
printing.py
theano/printing.py
+3
-2
没有找到文件。
doc/library/config.txt
浏览文件 @
37bf28f6
...
@@ -360,6 +360,14 @@ import theano and print the config variable, as in:
...
@@ -360,6 +360,14 @@ import theano and print the config variable, as in:
The profiling output can be either directed to stderr
The profiling output can be either directed to stderr
(default), or stdout or an arbitrary file.
(default), or stdout or an arbitrary file.
.. attribute:: config.profiling.debugprint
Bool value: either True or False
Default False
Do a debugprint of the profiled functions
.. attribute:: config.lib.amdlibm
.. attribute:: config.lib.amdlibm
Bool value: either True or False
Bool value: either True or False
...
...
theano/compile/profiling.py
浏览文件 @
37bf28f6
...
@@ -76,6 +76,13 @@ AddConfigVar('profiling.destination',
...
@@ -76,6 +76,13 @@ AddConfigVar('profiling.destination',
StrParam
(
'stderr'
),
StrParam
(
'stderr'
),
in_c_key
=
False
)
in_c_key
=
False
)
AddConfigVar
(
'profiling.debugprint'
,
"""
Do a debugprint of the profiled functions
"""
,
BoolParam
(
False
),
in_c_key
=
False
)
def
_atexit_print_fn
():
def
_atexit_print_fn
():
"""
"""
...
@@ -1285,6 +1292,9 @@ class ProfileStats(object):
...
@@ -1285,6 +1292,9 @@ class ProfileStats(object):
elif
self
.
fct_callcount
>
0
:
elif
self
.
fct_callcount
>
0
:
print
(
" No execution time accumulated "
print
(
" No execution time accumulated "
"(hint: try config profiling.time_thunks=1)"
,
file
=
file
)
"(hint: try config profiling.time_thunks=1)"
,
file
=
file
)
if
config
.
profiling
.
debugprint
:
fcts
=
set
([
n
.
fgraph
for
n
in
self
.
apply_time
.
keys
()])
theano
.
printing
.
debugprint
(
fcts
,
print_type
=
True
)
if
self
.
variable_shape
or
self
.
variable_strides
:
if
self
.
variable_shape
or
self
.
variable_strides
:
self
.
summary_memory
(
file
,
n_apply_to_print
)
self
.
summary_memory
(
file
,
n_apply_to_print
)
if
self
.
optimizer_profile
:
if
self
.
optimizer_profile
:
...
...
theano/printing.py
浏览文件 @
37bf28f6
...
@@ -102,7 +102,7 @@ def debugprint(obj, depth=-1, print_type=False,
...
@@ -102,7 +102,7 @@ def debugprint(obj, depth=-1, print_type=False,
results_to_print
=
[]
results_to_print
=
[]
profile_list
=
[]
profile_list
=
[]
order
=
[]
order
=
[]
if
isinstance
(
obj
,
(
list
,
tuple
)):
if
isinstance
(
obj
,
(
list
,
tuple
,
set
)):
lobj
=
obj
lobj
=
obj
else
:
else
:
lobj
=
[
obj
]
lobj
=
[
obj
]
...
@@ -120,7 +120,8 @@ def debugprint(obj, depth=-1, print_type=False,
...
@@ -120,7 +120,8 @@ def debugprint(obj, depth=-1, print_type=False,
order
=
obj
.
maker
.
fgraph
.
toposort
()
order
=
obj
.
maker
.
fgraph
.
toposort
()
elif
isinstance
(
obj
,
gof
.
FunctionGraph
):
elif
isinstance
(
obj
,
gof
.
FunctionGraph
):
results_to_print
.
extend
(
obj
.
outputs
)
results_to_print
.
extend
(
obj
.
outputs
)
profile_list
.
extend
([
None
for
item
in
obj
.
outputs
])
profile_list
.
extend
([
getattr
(
obj
,
'profile'
,
None
)
for
item
in
obj
.
outputs
])
order
=
obj
.
toposort
()
order
=
obj
.
toposort
()
elif
isinstance
(
obj
,
(
integer_types
,
float
,
np
.
ndarray
)):
elif
isinstance
(
obj
,
(
integer_types
,
float
,
np
.
ndarray
)):
print
(
obj
)
print
(
obj
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论