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

Commit

Permalink
fixed flaky test issue for test_operator_gpu.test_depthwise_convoluti…
Browse files Browse the repository at this point in the history
…on (#12402)

* fixed flaky test issue for test_operator_gpu.test_depthwise_convolution

* Changed implicit cast to explicit cast
  • Loading branch information
mseth10 authored and anirudh2290 committed Sep 1, 2018
1 parent 10e94f8 commit 58560f6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/python/unittest/test_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1616,7 +1616,6 @@ def test_convolution_grouping():
np.testing.assert_allclose(arr1.asnumpy(), arr2.asnumpy(), rtol=1e-3, atol=1e-3)


@unittest.skip("Flaky test https://github.com/apache/incubator-mxnet/issues/12203")
@with_seed()
def test_depthwise_convolution():
for dim in [1,2]:
Expand Down Expand Up @@ -1650,15 +1649,15 @@ def test_depthwise_convolution():
exe2 = y2.simple_bind(mx.cpu(), x=shape, w=(num_filter, shape[1]//num_group)+kernel,
b=(num_filter,))
for arr1, arr2 in zip(exe1.arg_arrays, exe2.arg_arrays):
arr1[:] = np.random.normal(size=arr1.shape)
arr1[:] = np.float32(np.random.normal(size=arr1.shape))
arr2[:] = arr1
exe1.forward(is_train=True)
exe1.backward(exe1.outputs[0])
exe2.forward(is_train=True)
exe2.backward(exe2.outputs[0])

for arr1, arr2 in zip(exe1.outputs + exe1.grad_arrays, exe2.outputs + exe2.grad_arrays):
np.testing.assert_allclose(arr1.asnumpy(), arr2.asnumpy(), rtol=1e-3, atol=1e-3)
np.testing.assert_allclose(arr1.asnumpy(), arr2.asnumpy(), rtol=1e-2, atol=1e-3)

def gen_broadcast_data(idx):
# Manually set test cases
Expand Down

0 comments on commit 58560f6

Please sign in to comment.