From c730af21068fb71e25dd35c0d0b9d2dc286ac1f6 Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Mon, 1 May 2023 03:36:35 +0000 Subject: [PATCH] chore(api/device): update type annotations --- nvitop/api/device.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/nvitop/api/device.py b/nvitop/api/device.py index ebe2afa..fa41546 100644 --- a/nvitop/api/device.py +++ b/nvitop/api/device.py @@ -2141,7 +2141,9 @@ class CudaDevice(Device): If the index is out of range for the given ``CUDA_VISIBLE_DEVICES`` environment variable. """ # pylint: disable=line-too-long - _nvml_index: int | tuple[int, int] + _nvml_index: int + index: int + nvml_index: int @classmethod def is_available(cls) -> bool: @@ -2317,9 +2319,9 @@ Device.cuda = CudaDevice class CudaMigDevice(CudaDevice, MigDevice): # type: ignore[misc] """Class for CUDA devices that are MIG devices.""" - _nvml_index: tuple[int, int] - index: tuple[int, int] - nvml_index: tuple[int, int] + _nvml_index: tuple[int, int] # type: ignore[assignment] + index: tuple[int, int] # type: ignore[assignment] + nvml_index: tuple[int, int] # type: ignore[assignment] def is_mig_device_uuid(uuid: str | None) -> bool: