1 import pytest 2 import torch 3 4 5 @pytest.fixture(autouse=True) 6 def clear_cuda_cache(): 7 yield 8 torch.cuda.empty_cache()