Closed Parskatt closed 4 years ago
Your example is not reproducible, and yields no error on my machine.
Moreover, since by default torch.linspace generates only 100 points, it's likely that with your example, computations run on Torch engine (and not KeOps engine), which mean that this error comes most likely from your configuration.
Sending x and y to GPU is not a requirement since computations can be run on CPU, and sending them automatically would not follow Torch paradigm.
You're right, it seems it is actually pytorch that is messing up somewhere, I'll close this.
If anyone else gets this issue, this is what causes it: https://github.com/pytorch/pytorch/issues/43300
Issue
Given the program sinkhorn_loss.py:
I would expect an exception to either be told to send my tensors to GPU (if that is required), or for the program to attempt to automatically send the tensors to the correct device.
However, what i get is:
Running the same code, but sending x,y to the GPU first produces no errors and gives the correct result (loss=0).
Suggested Solution
Perform a check in
SamplesLoss
to see that the input tensors are on the correct device, and either send an exception or transfer them.