I am using pytorch to train a deep learning model in GPU with amp. When the output contains nan, I try to skip this batch. How should I release all possible GPU memory to avoid the error: NAME_1.cuda.OutOfMemoryError: CUDA out of memory.   Think slowly and step by step. Think about how github issues and the community response. Make sure to only use capital letters in your entire response.
user