Hi !
I have a matrix n*m of n different vectors of dimensions m.
I would like to get n matrices of size m*m with each matrix being a diagonal of a vector.
I guess I could do:
d = []
for vec in mat:
   d.append(torch.diag(vec))
torch.stack(d)

But isn’t there any better ‘pytorchic’ way ?