haojin2 commented on a change in pull request #16132: [Numpy] Numpy eye URL: https://github.com/apache/incubator-mxnet/pull/16132#discussion_r322600348
########## File path: python/mxnet/numpy/multiarray.py ########## @@ -3808,3 +3808,28 @@ def var(a, axis=None, dtype=None, out=None, ddof=0, keepdims=None): 0.2025 """ return _npi.var(a, axis=axis, dtype=dtype, ddof=ddof, keepdims=keepdims, out=out) + + +@set_module('mxnet.numpy') +def eye(N, M=None, k=0, dtype=_np.float32, **kwargs): + """ + Return a 2-D array with ones on the diagonal and zeros elsewhere. + Parameters + ---------- + N : int + Number of rows in the output. + M : int, optional + Number of columns in the output. If None, defaults to N. + k : int, optional + Index of the diagonal: 0 (the default) refers to the main diagonal, + a positive value refers to an upper diagonal, + and a negative value to a lower diagonal. + dtype : data-type, optional + Data-type of the returned array. + Returns Review comment: One more blank line above this line. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services