Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
6fb77ff0
提交
6fb77ff0
authored
6月 02, 2015
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Comments
上级
9966c2fa
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
17 行增加
和
2 行删除
+17
-2
link.py
theano/gof/link.py
+6
-0
vm.py
theano/gof/vm.py
+11
-2
没有找到文件。
theano/gof/link.py
浏览文件 @
6fb77ff0
...
...
@@ -624,6 +624,12 @@ def gc_helper(node_list):
dictionary that maps each Variable instance to a the last node to use Variable as an input.
This is used to allow garbage collection within graphs.
It ignore view_map and destroy_map. This isn't needed as python
have referecence count. In Theano gc, we should not take into
account view_map and destroy_map as if the thunk decided to create
a new output, we would delay uselessly its gc by Python.
"""
# for freeing memory
last_user
=
{}
...
...
theano/gof/vm.py
浏览文件 @
6fb77ff0
...
...
@@ -378,8 +378,8 @@ class Stack(VM):
# destroy_dependencies
# --------------------
# The destroy_dependencies is a list of variables that are implicit
# dependencies induced by
a destroy_map (compare node.inputs which
# are *explicit* dependencies). The variables in
# dependencies induced by
destroy_map and view_map (compared to
#
node.inputs which
are *explicit* dependencies). The variables in
# destroy_dependencies would be impossible to compute after the
# current `node` runs, because node.thunk() is going to destroy a
# common input variable needed by whatever node owns each variable
...
...
@@ -787,6 +787,12 @@ class VM_Linker(link.LocalLinker):
N.B. gc means garbage collection
Note
----
It don't take care of the view_map/destroy_map. So
it mean it rely on Python gc to don't free the object real
storage.
"""
dependencies
=
{}
for
k
in
variables
:
...
...
@@ -796,6 +802,9 @@ class VM_Linker(link.LocalLinker):
# way of getting it back.
#
# XXX if k has no clients... what is it doing in the computation?
# Fred guess: it could happen for node with multiple outputs when
# we don't use all outputs.
if
k
.
owner
and
k
.
clients
:
ls
=
[]
for
cl
in
k
.
clients
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论