reminisce commented on a change in pull request #17609: [numpy] add fallback ops
URL: https://github.com/apache/incubator-mxnet/pull/17609#discussion_r380000883
##########
File path: python/mxnet/numpy/multiarray.py
##########
@@ -244,14 +274,10 @@ def __array_function__(self, func, types, args, kwargs):
# pylint: disable=bad-
mx_np_func = _NUMPY_ARRAY_FUNCTION_DICT.get(func, None)
if mx_np_func is None:
# try to fallback to official NumPy op
- new_args = []
- cur_ctx = None
- for arg in args:
- if isinstance(arg, ndarray):
- cur_ctx = arg.ctx
- new_args.append(arg.asnumpy())
- else:
- new_args.append(arg)
+ new_args, cur_ctx = _as_onp_array(args)
Review comment:
Please also remember to add the similar check at line 258 for fallback
through the ufunc protocol.
----------------------------------------------------------------
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