torch
torch copied to clipboard
Request: provide `to(device = "cuda_pseudo")` to test that code runs on GPU
First of all, thank you for your great package!
In order to test that code runs on CPUs and GPUs on machines (especially for CI) that does not have a GPU available, it would be convenient to have a cuda_pseudo
device. The tensor would still live on the "CPU", but combining tensors on e.g. a "cpu" and "cuda_pseudo" device should throw an error.
Hi @sebffischer !
Thanks for opening this issue!
You can try device="meta"
as mentioned here: https://github.com/pytorch/pytorch/issues/61654
It still won't error if for some reason an operation is not available on the CUDA device.
Actually we'll need https://github.com/mlverse/torch/pull/787 for this to work. But it won't be ideal because meta tensors doesn't have any data, so computations are not actually happening, making it hard to completely test the R code.