reminisce commented on a change in pull request #15698: Numpy Identity operator
URL: https://github.com/apache/incubator-mxnet/pull/15698#discussion_r311279550
##########
File path: python/mxnet/ndarray/numpy/_op.py
##########
@@ -170,14 +170,56 @@ def ones(shape, dtype=None, **kwargs):
out : ndarray
Array of zeros with the given shape, dtype, and ctx.
"""
- _sanity_check_params('zeros', ['order'], kwargs)
+ _sanity_check_params('ones', ['order'], kwargs)
ctx = kwargs.pop('ctx', current_context())
if ctx is None:
ctx = current_context()
dtype = _np.float32 if dtype is None else dtype
return _npi.ones(shape=shape, ctx=ctx, dtype=dtype, **kwargs)
+@set_module('mxnet.ndarray.numpy')
+def identity(n, dtype=None, **kwargs):
Review comment:
Change the interface to `identity(n, dtype=None, ctx=None)`.
----------------------------------------------------------------
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