I used “grad1 = grad.clone()” in my hook function. Other tensors are on GPU but it shows “grad1” is on CPU as “grad.clone()” is returning value in CPU. Even when function return the value, it gives error if return tensor is on GPU so need to convert in CPU again.
Is gradient normal flow on CPU? What can i do to convert all grad on GPU so that don’t require to switch from GPU and CPU.