提交 cb023e9e authored 作者: Olivier Delalleau's avatar Olivier Delalleau

'theano-cache clear' now clears cached module even if config.nocleanup is True

上级 bcf15e5d
...@@ -1005,7 +1005,8 @@ class ModuleCache(object): ...@@ -1005,7 +1005,8 @@ class ModuleCache(object):
self.loaded_key_pkl.remove(key_data.key_pkl) self.loaded_key_pkl.remove(key_data.key_pkl)
parent = os.path.dirname(entry) parent = os.path.dirname(entry)
assert parent.startswith(os.path.join(self.dirname, 'tmp')) assert parent.startswith(os.path.join(self.dirname, 'tmp'))
_rmtree(parent, msg='old cache directory', level='info') _rmtree(parent, msg='old cache directory', level='info',
ignore_nocleanup=True)
finally: finally:
compilelock.release_lock() compilelock.release_lock()
...@@ -1110,7 +1111,8 @@ class ModuleCache(object): ...@@ -1110,7 +1111,8 @@ class ModuleCache(object):
parent = os.path.dirname(entry) parent = os.path.dirname(entry)
assert parent.startswith(os.path.join(self.dirname, 'tmp')) assert parent.startswith(os.path.join(self.dirname, 'tmp'))
_rmtree(parent, msg='unversioned', level='info') _rmtree(parent, msg='unversioned', level='info',
ignore_nocleanup=True)
# Sanity check: all unversioned keys should have been removed at # Sanity check: all unversioned keys should have been removed at
# this point. # this point.
...@@ -1135,7 +1137,8 @@ class ModuleCache(object): ...@@ -1135,7 +1137,8 @@ class ModuleCache(object):
# take care of the clean-up. # take care of the clean-up.
if age > min_age: if age > min_age:
_rmtree(os.path.join(self.dirname, filename), _rmtree(os.path.join(self.dirname, filename),
msg='old unversioned', level='info') msg='old unversioned', level='info',
ignore_nocleanup=True)
finally: finally:
compilelock.release_lock() compilelock.release_lock()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论