Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
44e5c993
提交
44e5c993
authored
7月 15, 2016
作者:
Jakub Sygnowski
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
raising python errors instead of c asserts
上级
031400a6
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
22 行增加
和
11 行删除
+22
-11
lazylinker_c.c
theano/gof/lazylinker_c.c
+19
-8
vm.py
theano/gof/vm.py
+3
-3
没有找到文件。
theano/gof/lazylinker_c.c
浏览文件 @
44e5c993
...
...
@@ -801,24 +801,35 @@ CLazyLinker_call(PyObject *_self, PyObject *args, PyObject *kwds)
&
output_subset_ptr
))
return
NULL
;
int
err
=
0
;
// parse an output_subset list
// it is stored as a bool list of length n_output_vars: calculate a var or not
char
*
output_subset
=
NULL
;
int
output_subset_size
=
-
1
;
if
(
output_subset_ptr
!=
NULL
)
{
assert
(
PyList_Check
(
output_subset_ptr
));
output_subset_size
=
PyList_Size
(
output_subset_ptr
);
output_subset
=
(
char
*
)
calloc
(
self
->
n_output_vars
,
sizeof
(
char
));
for
(
int
it
=
0
;
it
<
output_subset_size
;
++
it
)
if
(
!
PyList_Check
(
output_subset_ptr
))
{
PyObject
*
elem
=
PyList_GetItem
(
output_subset_ptr
,
it
);
assert
(
PyInt_Check
(
elem
));
output_subset
[
PyInt_AsLong
(
elem
)]
=
1
;
err
=
1
;
PyErr_SetString
(
PyExc_RuntimeError
,
"Output_subset is not a list"
);
}
else
{
output_subset_size
=
PyList_Size
(
output_subset_ptr
);
output_subset
=
(
char
*
)
calloc
(
self
->
n_output_vars
,
sizeof
(
char
));
for
(
int
it
=
0
;
it
<
output_subset_size
;
++
it
)
{
PyObject
*
elem
=
PyList_GetItem
(
output_subset_ptr
,
it
);
if
(
!
PyInt_Check
(
elem
))
{
err
=
1
;
PyErr_SetString
(
PyExc_RuntimeError
,
"Some elements of output_subset list are not int"
);
}
output_subset
[
PyInt_AsLong
(
elem
)]
=
1
;
}
}
}
int
err
=
0
;
self
->
position_of_error
=
-
1
;
// create constants used to fill the var_compute_cells
PyObject
*
one
=
PyInt_FromLong
(
1
);
...
...
theano/gof/vm.py
浏览文件 @
44e5c993
...
...
@@ -842,7 +842,7 @@ class VM_Linker(link.LocalLinker):
if
(
self
.
callback
is
not
None
or
self
.
callback_input
is
not
None
or
(
config
.
profile
and
config
.
profile_memory
)
or
self
.
allow_partial_eval
):
(
self
.
allow_partial_eval
and
not
self
.
use_cloop
)
):
if
self
.
use_cloop
and
(
self
.
callback
is
not
None
or
self
.
callback_input
is
not
None
):
...
...
@@ -850,9 +850,9 @@ class VM_Linker(link.LocalLinker):
if
self
.
use_cloop
and
config
.
profile_memory
:
warnings
.
warn
(
'CVM does not support memory profile, using Stack VM.'
)
if
self
.
use_cloop
and
self
.
allow_partial_eval
:
if
not
self
.
use_cloop
and
self
.
allow_partial_eval
:
warnings
.
warn
(
'
CVM does not support partial evaluation yet
, '
'
LoopGCdoes not support partial evaluation
, '
'using Stack VM.'
)
# Needed for allow_gc=True, profiling and storage_map reuse
deps
=
self
.
compute_gc_dependencies
(
storage_map
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论