Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
3db224ef
提交
3db224ef
authored
2月 07, 2012
作者:
Olivier Delalleau
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
zip -> izip
上级
a73afb69
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
10 行增加
和
9 行删除
+10
-9
cc.py
theano/gof/cc.py
+10
-9
没有找到文件。
theano/gof/cc.py
浏览文件 @
3db224ef
...
...
@@ -6,6 +6,7 @@ Defines Linkers that deal with C implementations.
from
copy
import
copy
import
re
#for set_compiledir
import
os
,
sys
,
StringIO
from
itertools
import
izip
if
sys
.
version_info
[:
2
]
>=
(
2
,
5
):
...
...
@@ -733,8 +734,8 @@ class CLinker(link.Linker):
output_storage
,
keep_lock
=
keep_lock
)
return
thunk
,
\
[
link
.
Container
(
input
,
storage
)
for
input
,
storage
in
zip
(
self
.
env
.
inputs
,
input_storage
)],
\
[
link
.
Container
(
output
,
storage
,
True
)
for
output
,
storage
in
zip
(
self
.
env
.
outputs
,
output_storage
)],
\
[
link
.
Container
(
input
,
storage
)
for
input
,
storage
in
i
zip
(
self
.
env
.
inputs
,
input_storage
)],
\
[
link
.
Container
(
output
,
storage
,
True
)
for
output
,
storage
in
i
zip
(
self
.
env
.
outputs
,
output_storage
)],
\
error_storage
def
get_init_tasks
(
self
):
...
...
@@ -1302,8 +1303,8 @@ class OpWiseCLinker(link.LocalLinker):
release_lock
()
assert
get_lock
.
n_lock
==
orig_n_lock
return
f
,
[
link
.
Container
(
input
,
storage
)
for
input
,
storage
in
zip
(
env
.
inputs
,
input_storage
)],
\
[
link
.
Container
(
output
,
storage
,
True
)
for
output
,
storage
in
zip
(
env
.
outputs
,
output_storage
)],
\
return
f
,
[
link
.
Container
(
input
,
storage
)
for
input
,
storage
in
i
zip
(
env
.
inputs
,
input_storage
)],
\
[
link
.
Container
(
output
,
storage
,
True
)
for
output
,
storage
in
i
zip
(
env
.
outputs
,
output_storage
)],
\
thunks
,
order
...
...
@@ -1372,21 +1373,21 @@ class DualLinker(link.Linker):
_f
,
i2
,
o2
,
thunks2
,
order2
=
OpWiseCLinker
()
.
accept
(
env
,
no_recycling
=
no_recycling
)
.
make_all
(
**
kwargs
)
def
f
():
for
input1
,
input2
in
zip
(
i1
,
i2
):
for
input1
,
input2
in
i
zip
(
i1
,
i2
):
# set the inputs to be the same in both branches
# the copy is necessary in order for inplace ops not to interfere
input2
.
storage
[
0
]
=
copy
(
input1
.
storage
[
0
])
for
thunk1
,
thunk2
,
node1
,
node2
in
zip
(
thunks1
,
thunks2
,
order1
,
order2
):
for
output
,
storage
in
zip
(
node1
.
outputs
,
thunk1
.
outputs
):
for
thunk1
,
thunk2
,
node1
,
node2
in
i
zip
(
thunks1
,
thunks2
,
order1
,
order2
):
for
output
,
storage
in
i
zip
(
node1
.
outputs
,
thunk1
.
outputs
):
if
output
in
no_recycling
:
storage
[
0
]
=
None
for
output
,
storage
in
zip
(
node2
.
outputs
,
thunk2
.
outputs
):
for
output
,
storage
in
i
zip
(
node2
.
outputs
,
thunk2
.
outputs
):
if
output
in
no_recycling
:
storage
[
0
]
=
None
try
:
thunk1
()
thunk2
()
for
output1
,
output2
in
zip
(
thunk1
.
outputs
,
thunk2
.
outputs
):
for
output1
,
output2
in
i
zip
(
thunk1
.
outputs
,
thunk2
.
outputs
):
self
.
checker
(
output1
,
output2
)
except
Exception
:
link
.
raise_with_op
(
node1
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论