You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by zh...@apache.org on 2021/04/20 16:38:15 UTC

[incubator-mxnet] branch v1.x updated: fix test (#20191)

This is an automated email from the ASF dual-hosted git repository.

zhasheng pushed a commit to branch v1.x
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/v1.x by this push:
     new 83f697b  fix test (#20191)
83f697b is described below

commit 83f697b7bbbda29b73f59c48eb5369f5c82eddf8
Author: waytrue17 <52...@users.noreply.github.com>
AuthorDate: Tue Apr 20 09:36:19 2021 -0700

    fix test (#20191)
    
    Co-authored-by: Wei Chu <we...@amazon.com>
---
 tests/python/unittest/test_operator.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/tests/python/unittest/test_operator.py b/tests/python/unittest/test_operator.py
index 137cebd..b525075 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 test_take_grads():
     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