提交 39d1ecb7 authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Improved cleanup of cache directory:

- 'theano-cache clear' will now delete cache entries containing pickled files that cannot be unpickled. - Replaced some manual calls to shutil.rmtree by calls to _rmtree to standardize cache directory deletion. - Cache entries associated to KeyData objects whose keys are broken should now be cleared if the module file is gone. - More comprehensive cleanup of the entry_from_key, module_hash_to_key_data and loaded_key_pkl dictionaries when deleting a cache entry.
上级 feb03ba6
......@@ -6,7 +6,8 @@ from theano.gof.cc import get_module_cache
if len(sys.argv) == 1:
print config.compiledir
elif sys.argv[1] in ('clear'):
get_module_cache().clear(unversioned_min_age=-1, clear_base_files=True)
get_module_cache().clear(unversioned_min_age=-1, clear_base_files=True,
delete_if_unpickle_failure=True)
else:
print 'command "%s" not recognized' % sys.argv[1]
print 'Type "theano-cache" to print the cache location'
......
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论