From eda41dc4da63bfb28c109560d09650a984de5113 Mon Sep 17 00:00:00 2001 From: Mihir Patel Date: Thu, 29 Aug 2024 08:20:41 -0700 Subject: [PATCH] Explicit None Check in get_device (#3586) --- composer/utils/device.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer/utils/device.py b/composer/utils/device.py index d897468b6e..ba84f8f571 100644 --- a/composer/utils/device.py +++ b/composer/utils/device.py @@ -30,7 +30,7 @@ def get_device(device: Optional[Union[str, 'Device']] = None) -> 'Device': """ from composer.devices import DeviceCPU, DeviceGPU, DeviceHPU, DeviceMPS, DeviceNeuron, DeviceTPU - if not device: + if device is None: device = DeviceGPU() if torch.cuda.is_available() else DeviceCPU() elif isinstance(device, str): if device.lower() == 'cpu':