The link in your post implemented reduced SVD. You need to call
torch.linalg. svd (A , full_matrices=False)
to do the same.
Note that the returned UV is not unique. If you think it’s still not right, can you share some example?