[None][fix] add gc for test fixture (#8220)

Signed-off-by: Xin He (SW-GPU) <200704525+xinhe-nv@users.noreply.github.com>
This commit is contained in:
xinhe-nv 2025-10-10 17:50:25 +08:00 committed by GitHub
parent d3059dbd8a
commit 2655995a09
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)