提交 7403c637 authored 作者: James Bergstra's avatar James Bergstra

added theano-compiledir: a script that can print or clear the compiled cache

上级 c68b9e44
#!/usr/bin/env python
from theano.gof import cc
import sys, os
compiledir = cc.get_compiledir()
if len(sys.argv) == 1:
print compiledir
elif sys.argv[1] in ('clear'):
verbose = False
for l in os.listdir(compiledir):
if l.endswith('.so'):
if verbose: print 'removing', l
os.remove(os.path.join(compiledir, l))
elif l.endswith('.cpp'):
if verbose: print 'removing', l
os.remove(os.path.join(compiledir, l))
else:
if verbose: print 'skipping ', l
pass
else:
print 'command "%s" not recognized' % sys.argv[1]
sys.exit(1)
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论