RuntimeError: CUDA out of memory in pytorch while running

Getting this error while running my model

RuntimeError: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 22.06 GiB total capacity; 19.72 GiB already allocated; 8.38 MiB free; 20.41 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF