提交 30f8bbc8 authored 作者: Frederic's avatar Frederic

Sort the list of compiled op and add the type associated.

上级 a64ace01
...@@ -78,17 +78,27 @@ def print_compiledir_content(): ...@@ -78,17 +78,27 @@ def print_compiledir_content():
compiledir = theano.config.compiledir compiledir = theano.config.compiledir
print "List compiled op in theano this cache", compiledir print "List compiled op in theano this cache", compiledir
print "sub directory/Op/Associated Type"
print
table = []
for dir in os.listdir(compiledir): for dir in os.listdir(compiledir):
file = None file = None
try: try:
file = open(os.path.join(compiledir, dir, "key.pkl")) file = open(os.path.join(compiledir, dir, "key.pkl"))
keydata = cPickle.load(file) keydata = cPickle.load(file)
ops = list(set([x for x in flatten(keydata.keys) ops = list(set([x for x in flatten(keydata.keys)
if isinstance(x, theano.gof.Op)])) if isinstance(x, theano.gof.Op)]))
assert len(ops) == 1 assert len(ops) == 1
print dir, ops[0] types = list(set([x for x in flatten(keydata.keys)
if isinstance(x, theano.gof.Type)]))
table.append((dir, ops[0], types))
except IOError: except IOError:
pass pass
finally: finally:
if file is not None: if file is not None:
file.close() file.close()
table = sorted(table, key=lambda t: str(t[1]))
for dir, op, types in table:
print dir, op, types
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论