then it should be possible to calculate the batch pseudo inverse using the batch inverse like this:
def pinv(self, A):
        P1 = th.matmul(A.transpose(1,2), A)
        P2 = P1.inverse()
        P3 = th.matmul(P2, A.transpose(1,2))
        return P3

right?
Of course it would be the left inverse