Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
f43f33af
提交
f43f33af
authored
9月 26, 2009
作者:
James Bergstra
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
added comments
上级
10845218
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
10 行增加
和
3 行删除
+10
-3
cc.py
theano/gof/cc.py
+10
-3
没有找到文件。
theano/gof/cc.py
浏览文件 @
f43f33af
...
@@ -864,12 +864,12 @@ class CLinker(link.Linker):
...
@@ -864,12 +864,12 @@ class CLinker(link.Linker):
def
build_dynamic_module
(
self
):
def
build_dynamic_module
(
self
):
"""
Generate the code for this module, compile it, return the imported dynamic module
.
"""
Return a cmodule.DynamicModule instance full of the code for our env
.
"""
"""
self
.
code_gen
()
self
.
code_gen
()
module_name
=
self
.
hash
module_name
=
self
.
hash
cthunk
=
object
()
# dummy so weave can get the type
cthunk
=
object
()
# dummy so weave can get the type
##TODO: REMOVE ME
mod
=
cmodule
.
DynamicModule
(
module_name
)
mod
=
cmodule
.
DynamicModule
(
module_name
)
# The code of instantiate
# The code of instantiate
...
@@ -940,7 +940,7 @@ class CLinker(link.Linker):
...
@@ -940,7 +940,7 @@ class CLinker(link.Linker):
orphd
=
[[
orphan
.
data
]
for
orphan
in
self
.
orphans
]
orphd
=
[[
orphan
.
data
]
for
orphan
in
self
.
orphans
]
ret
=
module
.
instantiate
(
error_storage
,
*
(
in_storage
+
out_storage
+
orphd
))
ret
=
module
.
instantiate
(
error_storage
,
*
(
in_storage
+
out_storage
+
orphd
))
return
ret
return
ret
def
instantiate_code
(
self
,
n_args
):
def
instantiate_code
(
self
,
n_args
):
...
@@ -1007,6 +1007,11 @@ class OpWiseCLinker(link.LocalLinker):
...
@@ -1007,6 +1007,11 @@ class OpWiseCLinker(link.LocalLinker):
no_recycling can contain a list of Variables that belong to the env.
no_recycling can contain a list of Variables that belong to the env.
If a Variable is in no_recycling, CLinker will clear the output storage
If a Variable is in no_recycling, CLinker will clear the output storage
associated to it prior to computation (to avoid reusing it).
associated to it prior to computation (to avoid reusing it).
:note: This is in a sense the 'default' linker for Theano. The overhead of using the
OpWiseCLinker as compared with the CLinker is only noticeable for graphs of very small
tensors (such as 20 elements or less)
"""
"""
__cache__
=
{}
__cache__
=
{}
...
@@ -1053,6 +1058,8 @@ class OpWiseCLinker(link.LocalLinker):
...
@@ -1053,6 +1058,8 @@ class OpWiseCLinker(link.LocalLinker):
try
:
try
:
e
=
Env
(
*
graph
.
clone
(
node
.
inputs
,
node
.
outputs
))
e
=
Env
(
*
graph
.
clone
(
node
.
inputs
,
node
.
outputs
))
# TODO: 20090926 Replace this code with th cl = CLinker().... line. Trust
# ModuleCache for cache mechanism.
if
any
(
isinstance
(
input
,
graph
.
Value
)
for
input
in
node
.
inputs
):
if
any
(
isinstance
(
input
,
graph
.
Value
)
for
input
in
node
.
inputs
):
desc
=
None
desc
=
None
else
:
else
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论