Any way to improve device mismatch errors?

 mask = (pred_cc_volume != 0) & (~torch.isin(pred_cc_volume, tp))
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument test_elements in method wrapper_CUDA_isin_Tensor_Tensor)

Any way to gauge which is on what device from this error? Or is it worth putting in an effort to generate a pr/issue?

Hi @Soumya_Kundu.

You can try calling the .device method for both of your tensors, pred_cc_volume and tp to see which one is on the GPU or CPU.

If you want to issue a pull request, and modify the error message, the link is here Pull requests · pytorch/pytorch · GitHub