提交 97b4c370 authored 作者: Frederic's avatar Frederic

Small modif following code review(doc, python 2.4 compatibility, import)

上级 30f8bbc8
...@@ -32,5 +32,6 @@ else: ...@@ -32,5 +32,6 @@ else:
print 'command "%s" not recognized' % sys.argv[1] print 'command "%s" not recognized' % sys.argv[1]
print 'Type "theano-cache" to print the cache location' print 'Type "theano-cache" to print the cache location'
print 'Type "theano-cache clear" to erase the cache' print 'Type "theano-cache clear" to erase the cache'
print 'Type "theano-cache list" to print the cache containt'
sys.exit(1) sys.exit(1)
import cPickle
import errno import errno
import os import os
import platform import platform
...@@ -64,7 +65,6 @@ AddConfigVar('compiledir', ...@@ -64,7 +65,6 @@ AddConfigVar('compiledir',
def print_compiledir_content(): def print_compiledir_content():
import cPickle
def flatten(a): def flatten(a):
if isinstance(a, (tuple, list, set)): if isinstance(a, (tuple, list, set)):
...@@ -77,13 +77,14 @@ def print_compiledir_content(): ...@@ -77,13 +77,14 @@ def print_compiledir_content():
return [a] return [a]
compiledir = theano.config.compiledir compiledir = theano.config.compiledir
print "List compiled op in theano this cache", compiledir print "List compiled ops in this theano cache:", compiledir
print "sub directory/Op/Associated Type" print "sub directory/Op/Associated Type"
print print
table = [] table = []
for dir in os.listdir(compiledir): for dir in os.listdir(compiledir):
file = None file = None
try:
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)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论