Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
0935f2ac
提交
0935f2ac
authored
6月 11, 2008
作者:
James Bergstra
浏览文件
操作
浏览文件
下载
差异文件
merge
上级
2d8be02e
31e9ab5d
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
5 行增加
和
6 行删除
+5
-6
cc.py
gof/cc.py
+5
-6
没有找到文件。
gof/cc.py
浏览文件 @
0935f2ac
...
@@ -21,7 +21,7 @@ import utils
...
@@ -21,7 +21,7 @@ import utils
def
compile_dir
():
def
compile_dir
():
"""Return the directory in which scipy.weave should store code objects.
"""Return the directory
(name)
in which scipy.weave should store code objects.
If the environment variable THEANO_COMPILEDIR is set, its value is returned.
If the environment variable THEANO_COMPILEDIR is set, its value is returned.
If not, a directory of the form $HOME/.theano/compiledir_<platform Id>.
If not, a directory of the form $HOME/.theano/compiledir_<platform Id>.
...
@@ -29,11 +29,11 @@ def compile_dir():
...
@@ -29,11 +29,11 @@ def compile_dir():
As a test, this function touches the file __init__.py in the returned
As a test, this function touches the file __init__.py in the returned
directory, and raises OSError if there's a problem.
directory, and raises OSError if there's a problem.
A directory coming from THEANO_COMPILEDIR is not created automatically, but
The returned directory is created automatically using os.makedirs.
a directory in $HOME/.theano is created automatically.
This directory is appended to the sys.path search path before being
This directory is appended to the sys.path search path before being
returned, if the touch was successful.
returned, if the touch was successful.
"""
"""
if
os
.
getenv
(
'THEANO_COMPILEDIR'
):
if
os
.
getenv
(
'THEANO_COMPILEDIR'
):
cachedir
=
os
.
getenv
(
'THEANO_COMPILEDIR'
)
cachedir
=
os
.
getenv
(
'THEANO_COMPILEDIR'
)
...
@@ -43,9 +43,8 @@ def compile_dir():
...
@@ -43,9 +43,8 @@ def compile_dir():
import
re
import
re
platform_id
=
re
.
sub
(
"[
\
(
\
)
\
s]+"
,
"_"
,
platform_id
)
platform_id
=
re
.
sub
(
"[
\
(
\
)
\
s]+"
,
"_"
,
platform_id
)
cachedir
=
os
.
path
.
join
(
os
.
getenv
(
'HOME'
),
'.theano'
,
'compiledir_'
+
platform_id
)
cachedir
=
os
.
path
.
join
(
os
.
getenv
(
'HOME'
),
'.theano'
,
'compiledir_'
+
platform_id
)
if
not
os
.
access
(
cachedir
,
os
.
R_OK
|
os
.
W_OK
):
if
not
os
.
access
(
cachedir
,
os
.
R_OK
|
os
.
W_OK
):
#this may raise a number of problems, I think all of which are serious.
os
.
makedirs
(
cachedir
,
7
<<
6
)
#read-write-execute for this user only
os
.
makedirs
(
cachedir
,
7
<<
6
)
cachedir_init
=
cachedir
+
'/__init__.py'
cachedir_init
=
cachedir
+
'/__init__.py'
touch
=
os
.
system
(
'touch '
+
cachedir_init
)
touch
=
os
.
system
(
'touch '
+
cachedir_init
)
if
touch
:
if
touch
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论