提交 5b150c63 authored 作者: Frederic's avatar Frederic

Don't catch interrupt.

上级 e6e229ef
......@@ -443,7 +443,7 @@ class Env(utils.object2):
"""
try:
self._features.remove(feature)
except:
except Exception:
return
detach = getattr(feature, 'on_detach', None)
if detach is not None:
......
......@@ -23,7 +23,7 @@ class Test_DB(TestCase):
pass
else:
raise
except:
except Exception:
self.fail()
try:
......@@ -34,7 +34,7 @@ class Test_DB(TestCase):
pass
else:
raise
except:
except Exception:
self.fail()
try:
......@@ -45,7 +45,7 @@ class Test_DB(TestCase):
pass
else:
raise
except:
except Exception:
self.fail()
......@@ -299,13 +299,13 @@ class TestScan(unittest.TestCase):
for th_out, num_out in zip(theano_outs, numpy_outs):
try:
assert numpy.allclose(th_out, num_out)
except:
except Exception:
#import ipdb; ipdb.set_trace()
raise
for th_out, num_out in zip(shared_vars, numpy_shared):
try:
assert numpy.allclose(th_out.get_value(), num_out)
except:
except Exception:
#import ipdb; ipdb.set_trace()
raise
# Scenario 2 : Loose fit (sequences longer then required)
......
......@@ -496,7 +496,7 @@ class T_CrossentropyCategorical1Hot(unittest.TestCase):
try:
assert len(f.maker.env.toposort()) == 4
f(x_val, y_val)
except:
except Exception:
theano.printing.debugprint(f)
raise
......@@ -507,7 +507,7 @@ class T_CrossentropyCategorical1Hot(unittest.TestCase):
try:
assert len(g.maker.env.toposort()) == 4
g(x_val, y_val)
except:
except Exception:
theano.printing.debugprint(g)
raise
......@@ -525,7 +525,7 @@ class T_CrossentropyCategorical1Hot(unittest.TestCase):
try:
assert len(f.maker.env.toposort()) == 2 # [big_op, sum]
f(x_val, b_val, y_val)
except:
except Exception:
theano.printing.debugprint(f)
raise
......@@ -535,7 +535,7 @@ class T_CrossentropyCategorical1Hot(unittest.TestCase):
try:
assert len(g.maker.env.toposort()) == 4
g(x_val, b_val, y_val)
except:
except Exception:
theano.printing.debugprint(g)
raise
......@@ -553,7 +553,7 @@ class T_CrossentropyCategorical1Hot(unittest.TestCase):
try:
assert len(f.maker.env.toposort()) == 6
f(x_val, y_val)
except:
except Exception:
theano.printing.debugprint(f)
raise
......@@ -564,7 +564,7 @@ class T_CrossentropyCategorical1Hot(unittest.TestCase):
assert len(g.maker.env.toposort()) in (6,7) #there's an extra dimshuffle in there
# but I can't think of a good rule to get rid of it
g(x_val, y_val)
except:
except Exception:
theano.printing.debugprint(g)
raise
......@@ -580,7 +580,7 @@ class T_CrossentropyCategorical1Hot(unittest.TestCase):
theano.printing.debugprint(f)
try:
assert len(f.maker.env.toposort()) == 4
except:
except Exception:
theano.printing.debugprint(f)
raise
......@@ -590,7 +590,7 @@ class T_CrossentropyCategorical1Hot(unittest.TestCase):
try:
assert len(g.maker.env.toposort()) in (6,7)
g(x_val, b_val, y_val)
except:
except Exception:
theano.printing.debugprint(g)
raise
......@@ -624,7 +624,7 @@ class T_CrossentropyCategorical1Hot(unittest.TestCase):
try:
assert len(f.maker.env.toposort()) == 5
f(x_val, y_val)
except:
except Exception:
theano.printing.debugprint(f)
raise
......@@ -635,7 +635,7 @@ class T_CrossentropyCategorical1Hot(unittest.TestCase):
try:
assert len(g.maker.env.toposort()) == 5
g(x_val, y_val)
except:
except Exception:
theano.printing.debugprint(g)
raise
......@@ -671,7 +671,7 @@ class T_CrossentropyCategorical1Hot(unittest.TestCase):
prev, last = f.maker.env.toposort()[-2:]
assert len(f.maker.env.toposort()) == 5
f(x_val, y_val)
except:
except Exception:
theano.printing.debugprint(f)
raise
......@@ -684,7 +684,7 @@ class T_CrossentropyCategorical1Hot(unittest.TestCase):
assert softmax in ops
assert softmax_grad not in ops
g(x_val, y_val)
except:
except Exception:
theano.printing.debugprint(g)
raise
......@@ -723,7 +723,7 @@ class T_CrossentropyCategorical1Hot(unittest.TestCase):
prev, last = f.maker.env.toposort()[-2:]
assert len(f.maker.env.toposort()) == 3 # [big_op, sum, dim_shuffle]
f(x_val, b_val, y_val)
except:
except Exception:
theano.printing.debugprint(f)
raise
......@@ -742,7 +742,7 @@ class T_CrossentropyCategorical1Hot(unittest.TestCase):
assert softmax_with_bias in ops
assert softmax_grad not in ops
g(x_val, b_val, y_val)
except:
except Exception:
theano.printing.debugprint(g)
raise
......@@ -831,7 +831,7 @@ class T_CrossentropyCategorical1Hot(unittest.TestCase):
assert 5 <= len(f.maker.env.toposort()) <= 10
validate_fn_graph(f)
f(x_val, y_val, 0.1)
except:
except Exception:
theano.printing.debugprint(f)
raise
......@@ -841,7 +841,7 @@ class T_CrossentropyCategorical1Hot(unittest.TestCase):
assert 5 <= len(g.maker.env.toposort()) <= 12
validate_grad_graph(g)
g(x_val, y_val, 0.1)
except:
except Exception:
theano.printing.debugprint(g)
raise
......@@ -851,7 +851,7 @@ class T_CrossentropyCategorical1Hot(unittest.TestCase):
assert 8 <= len(h.maker.env.toposort()) <= 17
validate_grad_graph(h)
h(x_val, y_val, 0.1)
except:
except Exception:
theano.printing.debugprint(h)
raise
......
......@@ -61,7 +61,7 @@ def scalar_constructor(value, name=None, strict=False, allow_downcast=None):
raise TypeError()
try:
dtype=value.dtype
except:
except Exception:
dtype=numpy.asarray(value).dtype
dtype=str(dtype)
......@@ -75,6 +75,6 @@ def scalar_constructor(value, name=None, strict=False, allow_downcast=None):
value=numpy.array(value, copy=True),
name=name, strict=strict, allow_downcast=allow_downcast)
return rval
except:
except Exception:
traceback.print_exc()
raise
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论