Does torch.Tensor.to supports async GPU transfer? [SOLVED: yes]

It all in the title:

torch.Tensor.cuda has an async parameter that allows asynchronous transfer from pinned memory to GPU. Does torch.Tensor.to automatically uses async when possible?

I wasn’t able to find the relevant piece of source code.

It was added in the current master branch as non_blocking, since asynch will be a keyword in Python 3.7.
See the docs.
If you want to use it, you would have to build PyTorch from source. You can find the build instructions here.

1 Like

Nice, thank you very much.