import torch # 如正常则静默 a = torch.Tensor([1.]) # 如正常则静默 a.cuda() # 如正常则返回"tensor([ 1.], device=\'cuda:0\')" from torch.backends import cudnn # 如正常则静默 cudnn.is_acceptable(a.cuda()) # 如正常则返回 "True" 相关文章: 2021-11-30 2021-11-30 2021-10-20 2021-10-18 2021-11-29 2021-08-17 2021-11-30