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 2019/11/15 21:41:22 UTC
[GitHub] [incubator-mxnet] reminisce commented on a change in pull request
#16829: [Numpy][Operator] 'where' Implementation in MXNet
reminisce commented on a change in pull request #16829: [Numpy][Operator] 'where' Implementation in MXNet
URL: https://github.com/apache/incubator-mxnet/pull/16829#discussion_r347022548
##########
File path: python/mxnet/ndarray/numpy/_op.py
##########
@@ -5308,3 +5308,67 @@ def nan_to_num(x, copy=True, nan=0.0, posinf=None, neginf=None, **kwargs):
return _npi.nan_to_num(x, copy=copy, nan=nan, posinf=posinf, neginf=neginf, out=None)
else:
raise TypeError('type {} not supported'.format(str(type(x))))
+
+
+@set_module('mxnet.ndarray.numpy')
+def where(condition, x, y):
Review comment:
We need to support the case where there is only one input. You can do this for the imperative mode only by falling back to `condition.nonzero()`.
----------------------------------------------------------------
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
With regards,
Apache Git Services