提交 8710ab10 authored 作者: lamblin's avatar lamblin

Merge pull request #1203 from nouiz/fix_cachelock

Fix cachelock
...@@ -923,8 +923,11 @@ class ModuleCache(object): ...@@ -923,8 +923,11 @@ class ModuleCache(object):
# The op has c_code, so take the lock. # The op has c_code, so take the lock.
compilelock.get_lock() compilelock.get_lock()
lock_taken = True lock_taken = True
assert os.path.exists(location), (
"The directory just created shouldn't be deleted!") if not os.path.exists(location):
# Temporary fix, we should make sure it don't
# get deleted by the clear*() fct.
os.makedirs(path)
if module_hash in self.module_hash_to_key_data: if module_hash in self.module_hash_to_key_data:
_logger.debug("Duplicated module! Will re-use the " _logger.debug("Duplicated module! Will re-use the "
......
...@@ -9,7 +9,7 @@ class T_load_tensor(unittest.TestCase): ...@@ -9,7 +9,7 @@ class T_load_tensor(unittest.TestCase):
def setUp(self): def setUp(self):
self.data = numpy.arange(5, dtype=numpy.int32) self.data = numpy.arange(5, dtype=numpy.int32)
self.filename = os.path.join( self.filename = os.path.join(
theano.config.base_compiledir, theano.config.compiledir,
"_test.npy") "_test.npy")
numpy.save(self.filename, self.data) numpy.save(self.filename, self.data)
...@@ -52,5 +52,5 @@ class T_load_tensor(unittest.TestCase): ...@@ -52,5 +52,5 @@ class T_load_tensor(unittest.TestCase):
def tearDown(self): def tearDown(self):
os.remove(os.path.join( os.remove(os.path.join(
theano.config.base_compiledir, theano.config.compiledir,
"_test.npy")) "_test.npy"))
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论