jasonyu1996 commented on issue #12327: [Feature Request] support of diag for 
N-d arrays
URL: 
https://github.com/apache/incubator-mxnet/issues/12327#issuecomment-418571963
 
 
   @samskalicky Yes. Actually I have already implemented one version in this 
way (https://github.com/apache/incubator-mxnet/pull/12430), simply traversing 
and copying the data. However, I actually think it more efficient to just 
generate a new view, as is the case in numpy. The problem here is that MXNet 
seems to lack a good support for this, as I have reported here 
   https://github.com/apache/incubator-mxnet/issues/12449 .
   
   As for the possible usage of a diagonal operator, as far as I know, it is 
sometimes necessary to compute a regularizer based on the diagonal of a matrix 
(or the diagonals of a batch of matrices). `trace` might be sufficient at 
times, but in other cases, it might be more flexible to operate on the diagonal 
itself (e.g., when taking norm of the diagonal).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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

Reply via email to