Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
6cc10a50
提交
6cc10a50
authored
2月 03, 2012
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Print the number of op compiled by op class.
上级
b89f9007
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
28 行增加
和
8 行删除
+28
-8
compiledir.py
theano/gof/compiledir.py
+28
-8
没有找到文件。
theano/gof/compiledir.py
浏览文件 @
6cc10a50
...
...
@@ -121,11 +121,9 @@ def print_compiledir_content():
return
[
a
]
compiledir
=
theano
.
config
.
compiledir
print
"List compiled ops in this theano cache:"
,
compiledir
print
"sub directory/Op/Associated Type"
print
table
=
[]
more_then_one_ops
=
0
zeros_op
=
0
for
dir
in
os
.
listdir
(
compiledir
):
file
=
None
try
:
...
...
@@ -134,16 +132,38 @@ def print_compiledir_content():
keydata
=
cPickle
.
load
(
file
)
ops
=
list
(
set
([
x
for
x
in
flatten
(
keydata
.
keys
)
if
isinstance
(
x
,
theano
.
gof
.
Op
)]))
assert
len
(
ops
)
==
1
types
=
list
(
set
([
x
for
x
in
flatten
(
keydata
.
keys
)
if
isinstance
(
x
,
theano
.
gof
.
Type
)]))
table
.
append
((
dir
,
ops
[
0
],
types
))
if
len
(
ops
)
==
0
:
zeros_op
+=
1
elif
len
(
ops
)
>
1
:
more_then_one_ops
+=
1
else
:
types
=
list
(
set
([
x
for
x
in
flatten
(
keydata
.
keys
)
if
isinstance
(
x
,
theano
.
gof
.
Type
)]))
table
.
append
((
dir
,
ops
[
0
],
types
))
except
IOError
:
pass
finally
:
if
file
is
not
None
:
file
.
close
()
print
"List
%
d compiled individual op in this theano cache
%
s:"
%
(
len
(
table
),
compiledir
)
print
"sub directory/Op/a set of the different associated Theano type"
table
=
sorted
(
table
,
key
=
lambda
t
:
str
(
t
[
1
]))
table_op_class
=
{}
for
dir
,
op
,
types
in
table
:
print
dir
,
op
,
types
table_op_class
.
setdefault
(
op
.
__class__
,
0
)
table_op_class
[
op
.
__class__
]
+=
1
print
print
"List
%
d of individual compiled Op class and"
%
(
len
(
table_op_class
)),
print
" the number of time it got compiled"
table_op_class
=
sorted
(
table_op_class
.
iteritems
(),
key
=
lambda
t
:
t
[
1
])
for
op_class
,
nb
in
table_op_class
:
print
op_class
,
nb
print
(
"Skipped
%
d files that contained more then"
" 1 op (was compiled with the c linker)"
%
(
more_then_one_ops
))
print
(
"Skipped
%
d files that contained 0 op"
"(Are they always theano.scalar ops?)"
%
(
more_then_one_ops
))
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论