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 2020/07/12 19:11:05 UTC

[GitHub] [incubator-mxnet] yzhliu commented on a change in pull request #18660: [numpy] fix flaky mixed precision binary error

yzhliu commented on a change in pull request #18660:
URL: https://github.com/apache/incubator-mxnet/pull/18660#discussion_r453352397



##########
File path: tests/python/unittest/test_numpy_op.py
##########
@@ -3131,16 +3134,17 @@ def hybrid_forward(self, F, a, b, *args, **kwargs):
         'mod': (1.0, 5.0, None, None),
         'power': (1.0, 3.0, lambda y, x1, x2: _np.power(x1, x2 - 1.0) * x2,
                             lambda y, x1, x2: _np.power(x1, x2) * _np.log(x1)),
-        'equal': (0.0, 2.0, None, None),
-        'not_equal': (0.0, 2.0, None, None),
-        'greater': (0.0, 2.0, None, None),
-        'less': (0.0, 2.0, None, None),
-        'greater_equal': (0.0, 2.0, None, None),
-        'less_equal': (0.0, 2.0, None, None),
-        'logical_and': (0.0, 2.0, None, None),
-        'logical_or': (0.0, 2.0, None, None),
-        'logical_xor': (0.0, 2.0, None, None),
     }
+    if not has_tvm_ops():
+        funcs['equal'] = (0.0, 2.0, None, None)
+        funcs['not_equal'] = (0.0, 2.0, None, None)
+        funcs['greater'] = (0.0, 2.0, None, None)
+        funcs['less'] = (0.0, 2.0, None, None)
+        funcs['greater_equal'] = (0.0, 2.0, None, None)
+        funcs['less_equal'] = (0.0, 2.0, None, None)
+        funcs['logical_and'] = (0.0, 2.0, None, None)
+        funcs['logical_or'] = (0.0, 2.0, None, None)
+        funcs['logical_xor'] = (0.0, 2.0, None, None)

Review comment:
       I think there's a route to tvmop when it is enabled, can we disable such route for mixed-type operation? changing test does not seem to be a correct fix.

##########
File path: tests/python/unittest/test_numpy_op.py
##########
@@ -3075,6 +3074,10 @@ def __init__(self, func):
             def hybrid_forward(self, F, a, b, *args, **kwargs):
                 return getattr(F.np, self._func)(a, b)
 
+        if (func in ['multiply', 'mod', 'equal', 'not_equal', 'greater',
+                    'greater_equal', 'less', 'less_equal']) and \
+            (lshape == () or rshape == ()) :

Review comment:
       we need to document the different behavior in operators.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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