conftest.py 152 Bytes
Newer Older
yyy's avatar
yyy committed
1
2
3
4
5
6
7
8
9
10
import pytest
import torch

def clear_gpu_memory():
    '''
    clear GPU memory
    '''
    torch.cuda.empty_cache()
    print("GPU memory cleared.")