Multidimensional SVD

Hi all,

I need to perform the svd operation for batch of the matrices, is it possible to do this in a simple way with pyTorch? It is a standard function in numpy( https://docs.scipy.org/doc/numpy-1.12.0/reference/generated/numpy.linalg.svd.html)and I would like to know if this can be reproduced in pytorch. Thanks

There notes seem relevant for you

But there is not yet support for batched svd in pytorch. It seems that numpy just do a for loop over the batches, which would be easy to add on the CPU side, but on the GPU side it would be trickier.

You can use this code until it is not implemented officially (I do not have it on 0.4.1) https://gist.github.com/ferrine/0c0e03bd21323a048baab8dadc83cdcc

UPD after experiments with torch script I failed to make it faster than loop implementation

Hi again, guys!

I have some updates on this. I’ve implemented all this stuff on top of torch.script, but got stuck with a foor loop. This works (both cpu, gpu), but could be further optimized if only there is a parallel_for loop. Any ideas or plans to implement?