Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
7d42c60d
提交
7d42c60d
authored
8月 11, 2011
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Don't catch interup in try except.
上级
6a0b74bc
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
21 行增加
和
21 行删除
+21
-21
debugmode.py
theano/compile/debugmode.py
+11
-11
function_module.py
theano/compile/function_module.py
+3
-3
module.py
theano/compile/module.py
+1
-1
pfunc.py
theano/compile/pfunc.py
+1
-1
test_module.py
theano/compile/tests/test_module.py
+1
-1
printing.py
theano/printing.py
+1
-1
basic.py
theano/scalar/basic.py
+1
-1
scan_utils.py
theano/scan_module/scan_utils.py
+2
-2
没有找到文件。
theano/compile/debugmode.py
浏览文件 @
7d42c60d
...
...
@@ -152,7 +152,7 @@ class BadCLinkerOutput(DebugModeError):
print
>>
ssio
,
numpy
.
isnan
(
self
.
val_py
)
.
sum
(),
# only if all succeeds to we add anything to sio
print
>>
sio
,
ssio
.
getvalue
()
except
:
except
Exception
:
pass
try
:
ssio
=
StringIO
()
...
...
@@ -166,7 +166,7 @@ class BadCLinkerOutput(DebugModeError):
print
>>
ssio
,
numpy
.
isnan
(
self
.
val_c
)
.
sum
(),
# only if all succeeds to we add anything to sio
print
>>
sio
,
ssio
.
getvalue
()
except
:
except
Exception
:
pass
try
:
ov
=
numpy
.
asarray
(
self
.
val_c
)
...
...
@@ -184,7 +184,7 @@ class BadCLinkerOutput(DebugModeError):
print
>>
ssio
,
" Std Rel Diff: "
,
numpy
.
std
(
reldiff
)
# only if all succeeds to we add anything to sio
print
>>
sio
,
ssio
.
getvalue
()
except
:
except
Exception
:
pass
return
sio
.
getvalue
()
...
...
@@ -246,7 +246,7 @@ class BadOptimization(DebugModeError):
print
>>
ssio
,
self
.
old_r_val
.
strides
# only if all succeeds to we add anything to sio
print
>>
sio
,
ssio
.
getvalue
()
except
:
except
Exception
:
pass
str_old_r_val
=
str
(
self
.
old_r_val
)
...
...
@@ -263,7 +263,7 @@ class BadOptimization(DebugModeError):
print
>>
ssio
,
self
.
new_r_val
.
strides
# only if all succeeds to we add anything to sio
print
>>
sio
,
ssio
.
getvalue
()
except
:
except
Exception
:
pass
str_new_r_val
=
str
(
self
.
new_r_val
)
if
len
(
str_new_r_val
)
>
val_str_len_limit
:
...
...
@@ -286,7 +286,7 @@ class BadOptimization(DebugModeError):
print
>>
ssio
,
" Std Rel Diff: "
,
numpy
.
std
(
reldiff
)
# only if all succeeds to we add anything to sio
print
>>
sio
,
ssio
.
getvalue
()
except
:
except
Exception
:
pass
print
>>
sio
,
" Reason: "
,
str
(
self
.
reason
)
...
...
@@ -400,7 +400,7 @@ class InvalidValueError(DebugModeError):
v_min
=
v
.
min
()
v_max
=
v
.
max
()
v_isfinite
=
numpy
.
all
(
numpy
.
isfinite
(
v
))
except
:
except
Exception
:
pass
client_node
=
self
.
client_node
hint
=
self
.
hint
...
...
@@ -687,7 +687,7 @@ def _check_strides_match(a, b, warn_err, op):
try
:
strides_eq
=
a
.
strides
==
b
.
strides
except
:
except
Exception
:
return
# no strides
if
not
strides_eq
:
...
...
@@ -1435,7 +1435,7 @@ class _Linker(gof.link.LocalLinker):
## First time, with None in output_storage
try
:
thunk_c
()
except
:
except
Exception
:
raise_with_op
(
node
)
for
r
in
node
.
outputs
:
...
...
@@ -1475,7 +1475,7 @@ class _Linker(gof.link.LocalLinker):
def
thunk
():
try
:
thunk_c
()
except
:
except
Exception
:
raise_with_op
(
node
)
_logger
.
debug
(
'
%
i - calling _check_preallocated_output '
...
...
@@ -1547,7 +1547,7 @@ class _Linker(gof.link.LocalLinker):
storage_map
[
r
][
0
]
.
itemset
(
dr_vals
[
r
][
0
])
else
:
storage_map
[
r
][
0
]
=
dr_vals
[
r
][
0
]
except
:
except
Exception
:
# Restore the initial state of storage_map
for
r
in
storage_map
:
if
r
in
original_storage_map_keys
:
...
...
theano/compile/function_module.py
浏览文件 @
7d42c60d
...
...
@@ -597,7 +597,7 @@ class Function(object):
t0_fn
=
time
.
time
()
try
:
self
.
fn
()
except
:
except
Exception
:
if
hasattr
(
self
.
fn
,
'position_of_error'
):
# this is a new vm-provided function
# the C VM needs this because the exception manipulation
...
...
@@ -1107,7 +1107,7 @@ try:
# compatible with python 2.4, we implement pickling of slice
# ourself.
cPickle
.
dumps
(
slice
(
0
,
10
,
100
))
except
:
except
TypeError
:
# This slice pickle implementation seam backward and forward compatible.
def
_pickle_slice
(
s
):
return
(
slice
,
(
s
.
start
,
s
.
stop
,
s
.
step
))
...
...
@@ -1120,7 +1120,7 @@ def check_equal(x, y):
for
checker
in
__checkers
:
try
:
return
checker
(
x
,
y
)
except
:
except
Exception
:
continue
return
x
==
y
#raise Exception('No checker for equality between %s and %s' % (x, y))
...
...
theano/compile/module.py
浏览文件 @
7d42c60d
...
...
@@ -1120,7 +1120,7 @@ class Module(ComponentDict):
self
[
k
]
=
self
.
__wrapper__
(
recurse
(
v
))
try
:
self
[
k
]
=
self
.
__wrapper__
(
v
)
except
:
except
Exception
:
if
isinstance
(
v
,
Component
):
raise
else
:
...
...
theano/compile/pfunc.py
浏览文件 @
7d42c60d
...
...
@@ -143,7 +143,7 @@ def rebuild_collect_shared( outputs
replace
=
[]
try
:
replace_pairs
=
replace
.
items
()
except
:
except
Exception
:
replace_pairs
=
replace
for
v_orig
,
v_repl
in
replace_pairs
:
...
...
theano/compile/tests/test_module.py
浏览文件 @
7d42c60d
...
...
@@ -472,7 +472,7 @@ class T_module(unittest.TestCase):
m
=
M
.
make
()
try
:
m
.
y
=
77
#fail?
except
:
except
Exception
:
pass
assert
m
.
y
==
40
assert
m
.
f
(
20
)
==
100
...
...
theano/printing.py
浏览文件 @
7d42c60d
...
...
@@ -461,7 +461,7 @@ def pydotprint(fct, outfile=None,
try
:
import
pydot
as
pd
except
:
except
ImportError
:
print
"failed to import pydot. Yous must install pydot for this function to work."
return
...
...
theano/scalar/basic.py
浏览文件 @
7d42c60d
...
...
@@ -593,7 +593,7 @@ class unary_out_lookup(gof.utils.object2):
types
=
types
[
0
]
try
:
rval
=
self
.
tbl
[
types
]
except
:
except
Exception
:
raise
TypeError
(
types
)
if
isinstance
(
types
,
(
list
,
tuple
)):
return
rval
...
...
theano/scan_module/scan_utils.py
浏览文件 @
7d42c60d
...
...
@@ -249,7 +249,7 @@ def isNaN_or_Inf_or_None(x):
isNaN
=
numpy
.
isnan
(
x
)
isInf
=
numpy
.
isinf
(
x
)
isStr
=
isinstance
(
x
,
str
)
except
:
except
Exception
:
isNaN
=
False
isInf
=
False
isStr
=
False
...
...
@@ -258,7 +258,7 @@ def isNaN_or_Inf_or_None(x):
val
=
get_constant_value
(
x
)
isInf
=
numpy
.
isinf
(
val
)
isNaN
=
numpy
.
isnan
(
val
)
except
:
except
Exception
:
isNaN
=
False
isInf
=
False
if
isinstance
(
x
,
gof
.
Constant
)
and
isinstance
(
x
.
data
,
str
):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论