hzfan commented on a change in pull request #17817: [Numpy] FFI for np_where
URL: https://github.com/apache/incubator-mxnet/pull/17817#discussion_r392008301
 
 

 ##########
 File path: python/mxnet/ndarray/numpy/_op.py
 ##########
 @@ -7482,14 +7482,8 @@ def where(condition, x=None, y=None):  # pylint: 
disable=too-many-return-stateme
             else:
                 return y
         else:
-            if isinstance(x, numeric_types) and isinstance(y, numeric_types):
-                return _npi.where_scalar2(condition, float(x), float(y), 
out=None)
-            elif isinstance(x, NDArray) and isinstance(y, NDArray):
-                return _npi.where(condition, x, y, out=None)
-            elif isinstance(y, NDArray):
-                return _npi.where_lscalar(condition, y, float(x), out=None)
-            elif isinstance(x, NDArray):
-                return _npi.where_rscalar(condition, x, float(y), out=None)
+            if isinstance(x, NDArray) and isinstance(y, NDArray):
 
 Review comment:
   Seems `_api_internal.where` handles scalar cases. Why we do we need to check 
`isinstance(x, NDArray)` here?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to