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

Commit

Permalink
Fix flaky test for elementwise_sum (#11959)
Browse files Browse the repository at this point in the history
  • Loading branch information
anirudhacharya authored and nswamy committed Aug 9, 2018
1 parent 23d0c06 commit d762755
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/python/unittest/test_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,17 +292,17 @@ def check_elementwise_sum_with_shape(shape, n):
exec1.forward(is_train=True)
out1 = exec1.outputs[0].asnumpy()
out = sum(a.asnumpy() for a in arr)
assert_almost_equal(out, out1)
assert_almost_equal(out, out1, rtol=1e-5, atol=1e-5)

out_grad = mx.nd.empty(shape)
out_grad[:] = np.random.uniform(-10, 10, shape)
# backward
exec1.backward([out_grad])
for a in arr_grad:
assert_almost_equal(a.asnumpy(), out_grad.asnumpy())
assert_almost_equal(a.asnumpy(), out_grad.asnumpy(), rtol=1e-5, atol=1e-5)


@with_seed(0)
@with_seed()
def test_elementwise_sum():
nrepeat = 2
maxdim = 4
Expand Down

0 comments on commit d762755

Please sign in to comment.