@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). [ Full content available at: https://github.com/apache/incubator-mxnet/issues/12327 ] This message was relayed via gitbox.apache.org for [email protected]
