赞
踩
Mac computers with Apple silicon or AMD GPUs
macOS 12.3 or later
Python 3.7 or later
Xcode command-line tools: xcode-select --install
import torch
if torch.backends.mps.is_available():
mps_device = torch.device("mps")
x = torch.ones(1, device=mps_device)
print (x)
else:
print ("MPS device not found.")
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。