I am processing my model on a very large data set (of size about 1TB) by breaking it into chunks and then run a prediction on each chunks and then append the result in a file.
After running on each chunk I have to free the memory of GPU so that the other chunk can be processed and predicted.
Instead of running "Restart Kernel" again and again, I can run the loop if some command to clear the GPU memory exist.