📜  获取 gpu 名称 tensorflow 和 pytorch - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:34.681000             🧑  作者: Mango

代码示例1
# 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)