While reading a pytorch code there was comment where it said we have to once again move the model trained in the GPU to device using .to('CUDA'). So I was wondering the scope of .to('CUDA) ? Will it persist in the cuda memory until the program is terminated or the scope of function is terminated? what happens if we pass the model variable to another function? will it be affected?
Is transferring the model to run in GPU just a one time activity?