diff --git a/tests/integration/defs/conftest.py b/tests/integration/defs/conftest.py index c2478011bf..b1b8a17c9a 100644 --- a/tests/integration/defs/conftest.py +++ b/tests/integration/defs/conftest.py @@ -15,6 +15,7 @@ # -*- coding: utf-8 -*- import datetime +import gc import os import platform import re @@ -2524,6 +2525,7 @@ def torch_empty_cache() -> None: """ if torch.cuda.is_available(): torch.cuda.empty_cache() + gc.collect() @pytest.fixture(autouse=True)