# tensorflow from tensorflow.python.client import device_lib devices_tf = device_lib.list_local_devices() devices_tf = print(devices) # pytorch import torch devices_torch = torch.cuda.get_device_name() print(devices_torch)