提交 94e728c3 authored 作者: Frederic Bastien's avatar Frederic Bastien

If the env variable THEANO_BASE_COMPILEDIR, we will use it instead of ~/.theano…

If the env variable THEANO_BASE_COMPILEDIR, we will use it instead of ~/.theano as the base compile directory. We will create a directory based on the os in this directory and put their all file related to the compilation.
上级 38e81b7d
...@@ -30,7 +30,11 @@ def set_compiledir(path=None): ...@@ -30,7 +30,11 @@ def set_compiledir(path=None):
else: else:
platform_id = platform.platform() + '-' + platform.processor() platform_id = platform.platform() + '-' + platform.processor()
platform_id = re.sub("[\(\)\s]+", "_", platform_id) platform_id = re.sub("[\(\)\s]+", "_", platform_id)
path = os.path.join(os.getenv('HOME'), '.theano', 'compiledir_'+platform_id) if os.getenv('THEANO_BASE_COMPILEDIR'):
base = os.getenv('THEANO_BASE_COMPILEDIR')
else:
base = os.path.join(os.getenv('HOME'),'.theano')
path = os.path.join(base, 'compiledir_'+platform_id)
if not os.access(path, os.R_OK | os.W_OK): if not os.access(path, os.R_OK | os.W_OK):
try: try:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论