Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
d1e06e3a
提交
d1e06e3a
authored
8月 01, 2012
作者:
Olivier Delalleau
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #806 from lamblin/fix_n_calls
Make new VM_Linker with same options as the old one
上级
92e2e0a0
251a11b5
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
14 行增加
和
3 行删除
+14
-3
test_modes.py
theano/compile/tests/test_modes.py
+1
-1
vm.py
theano/gof/vm.py
+13
-2
没有找到文件。
theano/compile/tests/test_modes.py
浏览文件 @
d1e06e3a
...
@@ -32,7 +32,7 @@ class T_bunch_of_modes(unittest.TestCase):
...
@@ -32,7 +32,7 @@ class T_bunch_of_modes(unittest.TestCase):
# test that it runs something
# test that it runs something
f
([[
1
,
2
],
[
3
,
4
]],
[
5
,
6
])
f
([[
1
,
2
],
[
3
,
4
]],
[
5
,
6
])
linker_classes_involved
.
append
(
f
.
maker
.
mode
.
linker
.
__class__
)
linker_classes_involved
.
append
(
f
.
maker
.
mode
.
linker
.
__class__
)
#
print 'MODE:', mode, f.maker.mode.linker, 'stop'
#
print 'MODE:', mode, f.maker.mode.linker, 'stop'
# regression check:
# regression check:
# there should be
# there should be
# - VM_Linker
# - VM_Linker
...
...
theano/gof/vm.py
浏览文件 @
d1e06e3a
...
@@ -527,6 +527,8 @@ class VM_Linker(link.LocalLinker):
...
@@ -527,6 +527,8 @@ class VM_Linker(link.LocalLinker):
between Loop/LoopGC and Stack.
between Loop/LoopGC and Stack.
"""
"""
# Note: if more parameters are added to __init__, make sure to forward
# them in the "type(self)(...)" call in the "accept" method below.
if
allow_gc
is
None
:
if
allow_gc
is
None
:
allow_gc
=
config
.
allow_gc
allow_gc
=
config
.
allow_gc
self
.
fgraph
=
None
self
.
fgraph
=
None
...
@@ -543,12 +545,21 @@ class VM_Linker(link.LocalLinker):
...
@@ -543,12 +545,21 @@ class VM_Linker(link.LocalLinker):
:param no_recycling: WRITEME
:param no_recycling: WRITEME
:returns: self (TODO: WHY? Who calls this function?)
:returns: self if fgraph is the first FunctionGraph that has ever been
associated to self, else, a new VM_Linker associated to fgraph.
"""
"""
if
no_recycling
is
None
:
if
no_recycling
is
None
:
no_recycling
=
[]
no_recycling
=
[]
if
self
.
fgraph
is
not
None
and
self
.
fgraph
is
not
fgraph
:
if
self
.
fgraph
is
not
None
and
self
.
fgraph
is
not
fgraph
:
return
type
(
self
)()
.
accept
(
fgraph
,
no_recycling
)
# Build a new VM_Linker, and call accept on that one.
# Warning: make sure to forward the correct values of
# all parameters to __init__ here.
return
type
(
self
)(
allow_gc
=
self
.
allow_gc
,
use_cloop
=
self
.
use_cloop
,
callback
=
self
.
callback
,
lazy
=
self
.
lazy
)
.
accept
(
fgraph
,
no_recycling
)
self
.
fgraph
=
fgraph
self
.
fgraph
=
fgraph
self
.
no_recycling
=
no_recycling
self
.
no_recycling
=
no_recycling
return
self
return
self
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论