📅  最后修改于: 2022-03-11 14:46:34.681000             🧑  作者: Mango
# 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)