Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
b474effc
提交
b474effc
authored
7月 27, 2012
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix a bug in the VM/CVM GC that was the default in the trunk since the 5 July 2012.
This can cause wrong results with some combination of inplace op. Otherwise, it make stuff slower.
上级
c6e02ef2
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
15 行增加
和
5 行删除
+15
-5
lazylinker_c.c.txt
theano/gof/lazylinker_c.c.txt
+3
-2
lazylinker_c.py
theano/gof/lazylinker_c.py
+1
-1
vm.py
theano/gof/vm.py
+11
-2
没有找到文件。
theano/gof/lazylinker_c.c.txt
浏览文件 @
b474effc
...
...
@@ -771,7 +771,8 @@ int lazy_rec_eval(CLazyLinker * self, Py_ssize_t var_idx, PyObject*one, PyObject
Py_INCREF(Py_None);
err = PyList_SetItem(self->var_value_cells[i_idx], 0, Py_None);
self->var_computed[i_idx] = 0;
//See the Stack gc implementation for why we change it to 2 and not 0.
self->var_computed[i_idx] = 2;
if (err) goto fail;
}
}
...
...
@@ -972,7 +973,7 @@ static PyTypeObject lazylinker_ext_CLazyLinkerType = {
static PyObject * get_version(PyObject *dummy, PyObject *args)
{
PyObject *result = PyFloat_FromDouble(0.1
7
);
PyObject *result = PyFloat_FromDouble(0.1
8
);
return result;
}
...
...
theano/gof/lazylinker_c.py
浏览文件 @
b474effc
...
...
@@ -13,7 +13,7 @@ if config.compiledir not in sys.path:
sys
.
path
.
append
(
config
.
compiledir
)
force_compile
=
False
version
=
0.1
7
# must match constant returned in function get_version()
version
=
0.1
8
# must match constant returned in function get_version()
try
:
...
...
theano/gof/vm.py
浏览文件 @
b474effc
...
...
@@ -369,7 +369,14 @@ class Stack(VM):
if
all
(
compute_map
[
v
][
0
]
for
v
in
dependencies
[
i
]):
storage_map
[
i
][
0
]
=
None
compute_map
[
i
][
0
]
=
0
#DO NOT set compute_map to 0
#If values become False and the
#current_apply is still in the
#stack, this will cause it to be
#recomputed! This can cause wrong value
#with some combiation of inplace op.
compute_map
[
i
][
0
]
=
2
elif
not
computed_ins
:
# -- Non-lazy case, need inputs
apply_stack
.
append
(
current_apply
)
...
...
@@ -429,7 +436,9 @@ class Stack(VM):
break
if
empty_storage_map
:
storage_map
[
i
][
0
]
=
None
compute_map
[
i
][
0
]
=
None
#See the not lazy gc code for explanations
#Of compute_map change
compute_map
[
i
][
0
]
=
2
# Hacky coarse gc final pass
# This is required until we have a proper gc algorithm for graphs with
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论