提交 1d954660 authored 作者: Frederic's avatar Frederic

Remove now useless try..except

上级 eace612d
...@@ -452,7 +452,7 @@ class test_canonize(unittest.TestCase): ...@@ -452,7 +452,7 @@ class test_canonize(unittest.TestCase):
# We must be sure that the Canonizer is working, but that we don't have other # We must be sure that the Canonizer is working, but that we don't have other
# optimisation that could hide bug in the Canonizer as local_elemwise_fusion # optimisation that could hide bug in the Canonizer as local_elemwise_fusion
mode = compile.mode.get_default_mode() mode = compile.mode.get_default_mode()
try:
opt = gof.Query(["canonicalize"]) opt = gof.Query(["canonicalize"])
opt = opt.including('ShapeOpt') opt = opt.including('ShapeOpt')
opt = opt.excluding( opt = opt.excluding(
...@@ -512,7 +512,7 @@ class test_canonize(unittest.TestCase): ...@@ -512,7 +512,7 @@ class test_canonize(unittest.TestCase):
# must broadcast as their is a dimshuffle in the computation # must broadcast as their is a dimshuffle in the computation
((dx/dv)/dx, [dx, dv], [dxv, dvv], 1, 'float64'), ((dx/dv)/dx, [dx, dv], [dxv, dvv], 1, 'float64'),
# topo: [Shape_i, Shape_i, Elemwise{inv,no_inplace}(<TensorType(float64, row)>), Alloc] # topo: [Shape_i, Shape_i, Elemwise{inv,no_inplace}(<TensorType(float64, row)>), Alloc]
((fx/fv)/fx, [fx, fv], [fxv, fvv], 1, 'float32'), ((fx/fv)/fx, [fx, fv], [fxv, fvv], 1, 'float32'),
# topo:[Shape_i, Shape_i, Elemwise{inv,no_inplace}(<TensorType(float32, row)>), Alloc] # topo:[Shape_i, Shape_i, Elemwise{inv,no_inplace}(<TensorType(float32, row)>), Alloc]
]): ]):
...@@ -639,8 +639,6 @@ class test_canonize(unittest.TestCase): ...@@ -639,8 +639,6 @@ class test_canonize(unittest.TestCase):
assert numpy.all(numpy.isfinite(out)) assert numpy.all(numpy.isfinite(out))
assert numpy.allclose(out, numpy.sign(val_inputs[0]) * 2 / 3) assert numpy.allclose(out, numpy.sign(val_inputs[0]) * 2 / 3)
assert(out_dtype == out.dtype) assert(out_dtype == out.dtype)
finally:
pass
def test_abs_mul_div(self): def test_abs_mul_div(self):
""" """
...@@ -701,12 +699,12 @@ class test_canonize(unittest.TestCase): ...@@ -701,12 +699,12 @@ class test_canonize(unittest.TestCase):
# We must be sure that the Canonizer is working, but that we don't have other # We must be sure that the Canonizer is working, but that we don't have other
# optimisation that could hide bug in the Canonizer as local_elemwise_fusion # optimisation that could hide bug in the Canonizer as local_elemwise_fusion
mode = compile.mode.get_default_mode() mode = compile.mode.get_default_mode()
try:
opt = gof.Query(["canonicalize"]) opt = gof.Query(["canonicalize"])
opt = opt.excluding( opt = opt.excluding(
'local_elemwise_fusion') 'local_elemwise_fusion')
mode = mode.__class__(linker=mode.linker, optimizer=opt) mode = mode.__class__(linker=mode.linker, optimizer=opt)
# test fail! # test fail!
# test x / y / z -> x / (y * z) # test x / y / z -> x / (y * z)
for (g, sym_inputs, val_inputs, out_dtype) in [ for (g, sym_inputs, val_inputs, out_dtype) in [
((dx/dy)/dz, [dx, dy, dz], [dxv, dyv, dzv], 'float64'), ((dx/dy)/dz, [dx, dy, dz], [dxv, dyv, dzv], 'float64'),
...@@ -743,9 +741,6 @@ class test_canonize(unittest.TestCase): ...@@ -743,9 +741,6 @@ class test_canonize(unittest.TestCase):
assert len(topo[0].inputs) == 1 assert len(topo[0].inputs) == 1
assert(out_dtype == out.dtype) assert(out_dtype == out.dtype)
finally:
pass
def test_dont_merge_if_multiple_client(self): def test_dont_merge_if_multiple_client(self):
""" test those case take from the comment in Canonizer """ test those case take from the comment in Canonizer
""" """
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论