adithya, this is not strictly possible with pytorch because this will be very bad performance.
However, you can move your results to CPU immediately after finishing computation:
output = model(input.cuda())
output = output.cpu()