Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Change threshold for assert_almost_equal
Browse files Browse the repository at this point in the history
  • Loading branch information
junrushao committed Jul 13, 2018
1 parent 3ea7bda commit 168bd27
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/python/unittest/test_contrib_control_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,11 @@ def _zeros_like_dict(name_list):
for imp_out, sym_out in zip(imp_outs, sym_outs):
if imp_out is None or sym_out is None:
continue
assert_almost_equal(imp_out, sym_out)
assert_almost_equal(imp_out, sym_out, rtol=1e-4, atol=1e-4)
for imp_grad, sym_grad in zip(imp_grads, sym_grads):
if imp_grad is None or sym_grad is None:
continue
assert_almost_equal(imp_grad, sym_grad, rtol=1e-5, atol=1e-5)
assert_almost_equal(imp_grad, sym_grad, rtol=1e-4, atol=1e-4)


def test_while_loop_for_foreach():
Expand Down Expand Up @@ -886,9 +886,9 @@ def _get_sym_result(is_train, args, args_grad, out_grad):
assert len(imp_out) == len(sym_out)
assert len(imp_grad) == len(sym_grad)
for x, y in zip(imp_out, sym_out):
assert_almost_equal(x, y)
assert_almost_equal(x, y, rtol=1e-4, atol=1e-4)
for x, y in zip(imp_grad, sym_grad):
assert_almost_equal(x, y, rtol=1e-5, atol=1e-5)
assert_almost_equal(x, y, rtol=1e-4, atol=1e-4)


def test_while_loop_rnn():
Expand Down

0 comments on commit 168bd27

Please sign in to comment.