Skip to content

Commit

Permalink
bump up atol for test_bilinear_resize_op (apache#15011)
Browse files Browse the repository at this point in the history
  • Loading branch information
haojin2 authored and haohuw committed Jun 23, 2019
1 parent 471c06c commit 80c1b34
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/python/unittest/test_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -7441,16 +7441,16 @@ def check_bilinear_resize_modes_op(shape, scale_height=None, scale_width=None, s
assert_almost_equal(y.asnumpy(), expected, 1e-3, 0)
if mode != 'like':
resize_sym = mx.sym.contrib.BilinearResize2D(data_sym, None, scale_height=scale_height, scale_width=scale_width, mode=mode)
check_symbolic_forward(resize_sym, [data_np], [expected], rtol=1e-3)
check_symbolic_backward(resize_sym, [data_np], [out_grads], expected_backward, rtol=1e-3)
check_numeric_gradient(resize_sym, [data_np])
check_symbolic_forward(resize_sym, [data_np], [expected], rtol=1e-3, atol=1e-5)
check_symbolic_backward(resize_sym, [data_np], [out_grads], expected_backward, rtol=1e-3, atol=1e-5)
check_numeric_gradient(resize_sym, [data_np], rtol=1e-2, atol=1e-5)
else:
data_sym_like = mx.sym.var('data_like')
resize_sym = mx.sym.contrib.BilinearResize2D(data_sym, data_sym_like, mode=mode)
date_np_like = x_1.asnumpy()
check_symbolic_forward(resize_sym, [data_np, date_np_like], [expected], rtol=1e-3)
check_symbolic_backward(resize_sym, [data_np, date_np_like], [out_grads], expected_backward, rtol=1e-3)
check_numeric_gradient(resize_sym, [data_np, date_np_like])
check_symbolic_forward(resize_sym, [data_np, date_np_like], [expected], rtol=1e-3, atol=1e-5)
check_symbolic_backward(resize_sym, [data_np, date_np_like], [out_grads], expected_backward, rtol=1e-3, atol=1e-5)
check_numeric_gradient(resize_sym, [data_np, date_np_like], rtol=1e-2, atol=1e-5)

shape = (2, 2, 10, 10)
check_bilinear_resize_op(shape, 5, 5)
Expand Down

0 comments on commit 80c1b34

Please sign in to comment.