Given the matrix X in dimension of MxN. I want to create a diagonal matrix for every row of X. The result should be in MxNxN. How to do it efficiently? Thank you!
Asked
Active
Viewed 470 times