Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
56aa741b
提交
56aa741b
authored
11月 16, 2014
作者:
Nicolas Ballas
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
replace gof.vm.raise_with_op by gof.link.raise_with_op
上级
32876587
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
8 行增加
和
11 行删除
+8
-11
function_module.py
theano/compile/function_module.py
+1
-1
link.py
theano/gof/link.py
+1
-1
vm.py
theano/gof/vm.py
+6
-9
没有找到文件。
theano/compile/function_module.py
浏览文件 @
56aa741b
...
@@ -607,7 +607,7 @@ class Function(object):
...
@@ -607,7 +607,7 @@ class Function(object):
# For the c linker We don't have access from
# For the c linker We don't have access from
# python to all the temps values So for now, we
# python to all the temps values So for now, we
# just don't print the extra shapes/strides info
# just don't print the extra shapes/strides info
gof
.
vm
.
raise_with_op
(
gof
.
link
.
raise_with_op
(
self
.
fn
.
nodes
[
self
.
fn
.
position_of_error
])
self
.
fn
.
nodes
[
self
.
fn
.
position_of_error
])
else
:
else
:
# old-style linkers raise their own exceptions
# old-style linkers raise their own exceptions
...
...
theano/gof/link.py
浏览文件 @
56aa741b
...
@@ -56,7 +56,7 @@ sys.excepthook = thunk_hook
...
@@ -56,7 +56,7 @@ sys.excepthook = thunk_hook
# TODO: Make this work with linker defined schedule
# TODO: Make this work with linker defined schedule
def
raise_with_op
(
node
,
thunk
=
None
,
exc_info
=
None
):
def
raise_with_op
(
node
,
thunk
=
None
,
exc_info
=
None
,
func
=
None
):
"""
"""
Re-raise an exception while annotating the exception object with
Re-raise an exception while annotating the exception object with
debug info.
debug info.
...
...
theano/gof/vm.py
浏览文件 @
56aa741b
...
@@ -52,9 +52,6 @@ AddConfigVar('vm.lazy',
...
@@ -52,9 +52,6 @@ AddConfigVar('vm.lazy',
ConfigParam
(
'None'
,
filter_vm_lazy
),
ConfigParam
(
'None'
,
filter_vm_lazy
),
in_c_key
=
False
)
in_c_key
=
False
)
raise_with_op
=
link
.
raise_with_op
class
VM
(
object
):
class
VM
(
object
):
"""
"""
A VM object's __call__ method evaluates a Theano program.
A VM object's __call__ method evaluates a Theano program.
...
@@ -176,7 +173,7 @@ class Loop(VM):
...
@@ -176,7 +173,7 @@ class Loop(VM):
self
.
call_counts
[
i
]
+=
1
self
.
call_counts
[
i
]
+=
1
self
.
call_times
[
i
]
+=
t1
-
t0
self
.
call_times
[
i
]
+=
t1
-
t0
except
:
except
:
raise_with_op
(
node
,
thunk
)
link
.
raise_with_op
(
node
,
thunk
)
else
:
else
:
for
cont
in
self
.
pre_call_clear
:
for
cont
in
self
.
pre_call_clear
:
cont
[
0
]
=
None
cont
[
0
]
=
None
...
@@ -184,7 +181,7 @@ class Loop(VM):
...
@@ -184,7 +181,7 @@ class Loop(VM):
for
thunk
,
node
in
zip
(
self
.
thunks
,
self
.
nodes
):
for
thunk
,
node
in
zip
(
self
.
thunks
,
self
.
nodes
):
thunk
()
thunk
()
except
:
except
:
raise_with_op
(
node
,
thunk
)
link
.
raise_with_op
(
node
,
thunk
)
class
LoopGC
(
VM
):
class
LoopGC
(
VM
):
...
@@ -216,7 +213,7 @@ class LoopGC(VM):
...
@@ -216,7 +213,7 @@ class LoopGC(VM):
old_s
[
0
]
=
None
old_s
[
0
]
=
None
i
+=
1
i
+=
1
except
:
except
:
raise_with_op
(
node
,
thunk
)
link
.
raise_with_op
(
node
,
thunk
)
else
:
else
:
for
cont
in
self
.
pre_call_clear
:
for
cont
in
self
.
pre_call_clear
:
cont
[
0
]
=
None
cont
[
0
]
=
None
...
@@ -227,7 +224,7 @@ class LoopGC(VM):
...
@@ -227,7 +224,7 @@ class LoopGC(VM):
for
old_s
in
old_storage
:
for
old_s
in
old_storage
:
old_s
[
0
]
=
None
old_s
[
0
]
=
None
except
:
except
:
raise_with_op
(
node
,
thunk
)
link
.
raise_with_op
(
node
,
thunk
)
class
Stack
(
VM
):
class
Stack
(
VM
):
...
@@ -418,7 +415,7 @@ class Stack(VM):
...
@@ -418,7 +415,7 @@ class Stack(VM):
st
=
"c"
st
=
"c"
self
.
variable_strides
[
var
]
=
st
self
.
variable_strides
[
var
]
=
st
except
Exception
:
except
Exception
:
raise_with_op
(
current_apply
,
link
.
raise_with_op
(
current_apply
,
self
.
thunks
[
self
.
node_idx
[
current_apply
]])
self
.
thunks
[
self
.
node_idx
[
current_apply
]])
for
o
in
current_apply
.
outputs
:
for
o
in
current_apply
.
outputs
:
compute_map
[
o
][
0
]
=
1
compute_map
[
o
][
0
]
=
1
...
@@ -486,7 +483,7 @@ class Stack(VM):
...
@@ -486,7 +483,7 @@ class Stack(VM):
self
.
call_times
[
current_idx
]
+=
dt
self
.
call_times
[
current_idx
]
+=
dt
except
Exception
:
except
Exception
:
raise_with_op
(
current_apply
,
link
.
raise_with_op
(
current_apply
,
self
.
thunks
[
self
.
node_idx
[
current_apply
]])
self
.
thunks
[
self
.
node_idx
[
current_apply
]])
if
requires
:
if
requires
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论