From 02ecb34c25c068f876302afaaeb07b4d03d687e7 Mon Sep 17 00:00:00 2001 From: Won-Kyu Park Date: Sat, 12 Oct 2024 22:52:40 +0900 Subject: [PATCH] lint --- cuda_malloc.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cuda_malloc.py b/cuda_malloc.py index 41bd1368ee8..beabdf61523 100644 --- a/cuda_malloc.py +++ b/cuda_malloc.py @@ -39,9 +39,9 @@ def enum_display_devices(): else: gpu_names = set() out = subprocess.check_output(['nvidia-smi', '-L']) - for l in out.split(b'\n'): - if len(l) > 0: - gpu_names.add(l.decode('utf-8').split(' (UUID')[0]) + for line in out.split(b'\n'): + if len(line) > 0: + gpu_names.add(line.decode('utf-8').split(' (UUID')[0]) return gpu_names blacklist = {"GeForce GTX TITAN X", "GeForce GTX 980", "GeForce GTX 970", "GeForce GTX 960", "GeForce GTX 950", "GeForce 945M", @@ -55,7 +55,7 @@ def enum_display_devices(): def cuda_malloc_supported(): try: names = get_gpu_names() - except: + except Exception: names = set() for x in names: if "NVIDIA" in x: @@ -82,7 +82,7 @@ def cuda_malloc_supported(): version = module.__version__ if int(version[0]) >= 2: #enable by default for torch version 2.0 and up args.cuda_malloc = cuda_malloc_supported() - except: + except Exception: pass