You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/08/17 21:48:41 UTC

[GitHub] larroy commented on a change in pull request #11875: fix flaky test: test_broadcast_binary_op

larroy commented on a change in pull request #11875: fix flaky test: test_broadcast_binary_op
URL: https://github.com/apache/incubator-mxnet/pull/11875#discussion_r211040540
 
 

 ##########
 File path: tests/python/unittest/test_operator.py
 ##########
 @@ -1911,10 +1911,18 @@ def test_bdiv(a, b):
         check_binary_op_forward(c, lambda a, b: a / b, gen_broadcast_data, mx_nd_func=mx.nd.divide)
         check_binary_op_backward(c, lambda g_out, a, b: (g_out / b, - g_out * a / (b * b)), gen_broadcast_data)
 
-    def test_bmod(a, b):
+    def test_bmod(a_, b_):
+        # Python and numpy operate only in double so to avoid numerical errors we have to use
+        # doubles as well. This was a flaky test before when using float32. seed 1688524483, 1768433044
+        a = mx.sym.cast(a_, dtype='float64')
+        b = mx.sym.cast(b_, dtype='float64')
+        mx.sym.cast(b, dtype='float64')
 
 Review comment:
   ?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services