diff --git a/tests/python/unittest/test_operator.py b/tests/python/unittest/test_operator.py index 137cebd74ecd..b525075c84aa 100644 --- a/tests/python/unittest/test_operator.py +++ b/tests/python/unittest/test_operator.py @@ -10041,10 +10041,7 @@ def test_scalarop_locale_invariance(): finally: locale.setlocale(locale.LC_NUMERIC, prev) -if __name__ == '__main__': - import nose - nose.runmodule() - +@with_seed() def test_take_grads(): # Test for https://github.com/apache/incubator-mxnet/issues/19817 from mxnet.gluon.nn import HybridBlock, Conv1D, HybridSequential, HybridLambda, Dense @@ -10133,4 +10130,8 @@ def hybrid_forward(self, F, X, axis=-1): grads2 = run_model(model2, loss, X, Y) for i in range(len(grads1)): - assert_almost_equal(grads1[i], grads2[i]) \ No newline at end of file + assert_almost_equal(grads1[i], grads2[i]) + +if __name__ == '__main__': + import nose + nose.runmodule() \ No newline at end of file