TypeError: expected TensorOptions(dtype=long int, device=cpu, layout=Strided, requires_grad=false (default), pinned_memory=false (default), memory_format=(nullopt)) (got TensorOptions(dtype=long int, device=cuda:0, layout=Strided, requires_grad=false (default), pinned_memory=false (default), memory_format=(nullopt))) site:stackoverflow.com

It doesn’t seems to a general tensor different error. I think pytorch is converting internally my model to cpu. Please explain.
When i convert my tensor input tensor to cpu. I got reverse error that my model is on gpu. Please let me know if model code required. I am troubling with theory.
Its giving error here: torch.LongTensor(nodes)