Hi! Thank you for your response! I just paid a visit to the numpy interfaces for computing the diagonal, and noticed that besides `numpy.diag` (which is exactly where our the design of our `diag` operator comes from) numpy provides a second diagonal extracting function `numpy.diagonal` (https://www.numpy.org/devdocs/reference/generated/numpy.diagonal.html), which in my opinion is a good reference for extending the functionality of our `diag` operator. However, I am not sure whether a new operator should be added or not. I wonder why numpy provides two functions, one strictly weaker than the other, which do the same thing.
As for the implementation detail, I have to admit that I am not familiar with this and am therefore not sure about the possibility of further improving the performance by implementing it in ways other than simply fusing some high-level function calls together. I think it is possibly necessary to refer to the implementation of the 2-d case, which it seems does not depend on other high-level function calls (`diag` for 2-d arrays can also be implemented with an `arange` followed by a `pick`). [ Full content available at: https://github.com/apache/incubator-mxnet/issues/12327 ] This message was relayed via gitbox.apache.org for [email protected]
