1
0
Fork 0

fix(api): log number of active threads when running GC (#170)

This commit is contained in:
Sean Sube 2023-02-17 21:56:03 -06:00
parent aec44aaaeb
commit d09446ca68
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
1 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,7 @@
import gc
from logging import getLogger
from os import environ, path
import threading
from typing import Any, Dict, List, Optional, Union
import torch
@ -135,7 +136,7 @@ def get_size(val: Union[int, str, None]) -> SizeChart:
def run_gc(devices: List[DeviceParams] = []):
logger.debug("running garbage collection")
logger.debug("running garbage collection with %s active threads", threading.active_count())
gc.collect()
if torch.cuda.is_available():