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/14 21:07:51 UTC

[GitHub] [incubator-mxnet] CassiniXu commented on a change in pull request #16813: add numpy op diagflat [numpy]

CassiniXu commented on a change in pull request #16813: add numpy op diagflat [numpy]
URL: https://github.com/apache/incubator-mxnet/pull/16813#discussion_r346546153
 
 

 ##########
 File path: python/mxnet/ndarray/numpy/_op.py
 ##########
 @@ -5308,3 +5307,57 @@ 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 diagflat(arr, k=0):
+    """
+    Create a two-dimensional array with the flattened input as a diagonal.
+    Parameters: 
+    
+    v : array_like
+    
+    Input data, which is flattened and set as the k-th diagonal of the output.
+    k : int, optional
+    
+    Diagonal to set; 0, the default, corresponds to the "main" diagonal, a positive (negative) k giving the number of the diagonal above (below) the main.
+    
+    Returns:    
 
 Review comment:
   get

----------------------------------------------------------------
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