gpu can be reset by
torch.cuda.empty_cache() # Reset peak memory stats (optional) torch.cuda.reset_peak_memory_stats()