Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
abe6574c
提交
abe6574c
authored
2月 23, 2017
作者:
Frédéric Bastien
提交者:
GitHub
2月 23, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #5599 from lamblin/print_scan_profile
Print scan profile again
上级
fba3e888
bc92ddec
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
18 行增加
和
18 行删除
+18
-18
profiling.py
theano/compile/profiling.py
+18
-17
test_flake8.py
theano/tests/test_flake8.py
+0
-1
没有找到文件。
theano/compile/profiling.py
浏览文件 @
abe6574c
...
...
@@ -9,30 +9,29 @@ ProfileStats object for runtime and memory profiling.
#
from
__future__
import
absolute_import
,
print_function
,
division
import
logging
__authors__
=
"James Bergstra"
__reviewer__
=
"Razvan Pascanu"
__copyright__
=
"(c) 2011, Universite de Montreal"
__license__
=
"3-clause BSD License"
__contact__
=
"theano-dev <theano-dev@googlegroups.com>"
__docformat__
=
"restructuredtext en"
import
atexit
import
copy
import
logging
import
operator
import
os
import
sys
import
time
from
collections
import
defaultdict
from
six
import
iteritems
import
numpy
as
np
import
theano
from
six
import
iteritems
from
theano.gof
import
graph
__authors__
=
"James Bergstra"
__reviewer__
=
"Razvan Pascanu"
__copyright__
=
"(c) 2011, Universite de Montreal"
__license__
=
"3-clause BSD License"
__contact__
=
"theano-dev <theano-dev@googlegroups.com>"
__docformat__
=
"restructuredtext en"
logger
=
logging
.
getLogger
(
'theano.compile.profiling'
)
theano_imported_time
=
time
.
time
()
...
...
@@ -62,8 +61,9 @@ def _atexit_print_fn():
# Reverse sort in the order of compile+exec time
for
ps
in
sorted
(
_atexit_print_list
,
key
=
lambda
a
:
a
.
compile_time
+
a
.
fct_call_time
)[::
-
1
]:
if
ps
.
fct_callcount
>=
1
or
ps
.
compile_time
>
1
:
key
=
lambda
a
:
a
.
compile_time
+
a
.
fct_call_time
)[::
-
1
]:
if
(
ps
.
fct_callcount
>=
1
or
ps
.
compile_time
>
1
or
getattr
(
ps
,
'callcount'
,
0
)
>
1
):
ps
.
summary
(
file
=
destination_file
,
n_ops_to_print
=
config
.
profiling
.
n_ops
,
n_apply_to_print
=
config
.
profiling
.
n_apply
)
...
...
@@ -115,6 +115,7 @@ def _atexit_print_fn():
if
config
.
print_global_stats
:
print_global_stats
()
def
print_global_stats
():
"""
Print the following stats:
...
...
@@ -132,7 +133,7 @@ def print_global_stats():
else
:
destination_file
=
open
(
config
.
profiling
.
destination
,
'w'
)
print
(
'='
*
50
,
file
=
destination_file
)
print
(
'='
*
50
,
file
=
destination_file
)
print
(
'Global stats: '
,
'Time elasped since Theano import =
%6.3
fs, '
'Time spent in Theano functions =
%6.3
fs, '
...
...
@@ -143,7 +144,7 @@ def print_global_stats():
total_graph_opt_time
,
total_time_linker
),
file
=
destination_file
)
print
(
'='
*
50
,
file
=
destination_file
)
print
(
'='
*
50
,
file
=
destination_file
)
class
ProfileStats
(
object
):
...
...
@@ -728,7 +729,7 @@ class ProfileStats(object):
file
=
file
)
for
node
,
t
in
sorted
(
self
.
linker_make_thunk_time
.
items
(),
key
=
operator
.
itemgetter
(
1
))[::
-
1
][:
5
]:
key
=
operator
.
itemgetter
(
1
))[::
-
1
][:
5
]:
print
(
' Node
%
s time
%
es'
%
(
node
,
t
),
file
=
file
)
print
(
''
,
file
=
file
)
...
...
@@ -1131,7 +1132,7 @@ class ProfileStats(object):
# Store the max of some stats by any function in this profile.
max_sum_size
=
max
(
max_sum_size
,
sum_size
)
def
compute_max_stats
(
running_memory
,
stats
):
(
max_node_memory_size
,
max_running_max_memory_size
,
...
...
theano/tests/test_flake8.py
浏览文件 @
abe6574c
...
...
@@ -37,7 +37,6 @@ whitelist_flake8 = [
"__init__.py"
,
"tests/__init__.py"
,
"compile/__init__.py"
,
"compile/profiling.py"
,
"compile/sandbox/__init__.py"
,
"compile/tests/__init__.py"
,
"gpuarray/__init__.py"
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论