import torch
from torch.backends import cudnn

if __name__== "__main__":
     print(torch.cuda.is_available())
     x =  torch.tensor([10.])
     x = x.cuda()
     print(cudnn.is_acceptable(x)) 
torch.backends.cudnn.enabled = True#启动cudnn
torch.backends.cudnn.benchmark = True#启动cudnn的不确定性算法的自动搜索优化模式,适合输入数据维度比较固定的情况,否则应该关闭此项。

相关文章:

  • 2021-09-01
  • 2021-09-07
  • 2021-06-22
  • 2021-06-27
  • 2021-05-22
  • 2021-06-24
  • 2021-12-02
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-30
  • 2021-04-22
  • 2021-06-17
  • 2021-05-27
  • 2021-08-17
  • 2021-04-17
相关资源
相似解决方案