Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
15f3621e
提交
15f3621e
authored
10月 01, 2012
作者:
nouiz
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #975 from lamblin/expand_home
Expand ~ in base_compiledir and compiledir.
上级
3df0b3b7
35a02923
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
15 行增加
和
5 行删除
+15
-5
compiledir.py
theano/gof/compiledir.py
+12
-2
test_io.py
theano/tensor/tests/test_io.py
+3
-3
没有找到文件。
theano/gof/compiledir.py
浏览文件 @
15f3621e
...
...
@@ -58,7 +58,14 @@ def default_compiledirname():
return
safe
def
filter_base_compiledir
(
path
):
# Expand '~' in path
return
os
.
path
.
expanduser
(
str
(
path
))
def
filter_compiledir
(
path
):
# Expand '~' in path
path
=
os
.
path
.
expanduser
(
path
)
# Turn path into the 'real' path. This ensures that:
# 1. There is no relative path, which would fail e.g. when trying to
# import modules from the compile dir.
...
...
@@ -119,13 +126,16 @@ else:
AddConfigVar
(
'base_compiledir'
,
"platform-independent root directory for compiled modules"
,
StrParam
(
default_base_compiledir
,
allow_override
=
False
))
ConfigParam
(
default_base_compiledir
,
filter
=
filter_base_compiledir
,
allow_override
=
False
))
AddConfigVar
(
'compiledir'
,
"platform-dependent cache directory for compiled modules"
,
ConfigParam
(
os
.
path
.
join
(
os
.
path
.
expanduser
(
config
.
base_compiledir
)
,
config
.
base_compiledir
,
default_compiledirname
()),
filter
=
filter_compiledir
,
allow_override
=
False
))
...
...
theano/tensor/tests/test_io.py
浏览文件 @
15f3621e
...
...
@@ -9,7 +9,7 @@ class T_load_tensor(unittest.TestCase):
def
test0
(
self
):
data
=
numpy
.
arange
(
5
,
dtype
=
numpy
.
int32
)
filename
=
os
.
path
.
join
(
os
.
path
.
expanduser
(
theano
.
config
.
base_compiledir
)
,
theano
.
config
.
base_compiledir
,
"_test.npy"
)
numpy
.
save
(
filename
,
data
)
path
=
Variable
(
Generic
())
...
...
@@ -21,7 +21,7 @@ class T_load_tensor(unittest.TestCase):
def
test_memmap
(
self
):
data
=
numpy
.
arange
(
5
,
dtype
=
numpy
.
int32
)
filename
=
os
.
path
.
join
(
os
.
path
.
expanduser
(
theano
.
config
.
base_compiledir
)
,
theano
.
config
.
base_compiledir
,
"_test.npy"
)
numpy
.
save
(
filename
,
data
)
path
=
Variable
(
Generic
())
...
...
@@ -31,5 +31,5 @@ class T_load_tensor(unittest.TestCase):
def
tearDown
(
self
):
os
.
remove
(
os
.
path
.
join
(
os
.
path
.
expanduser
(
theano
.
config
.
base_compiledir
)
,
theano
.
config
.
base_compiledir
,
"_test.npy"
))
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论