# device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
os.environ["CUDA_VISIBLE_DEVICES"]="0,1"
# test=torch.cuda.is_available()
print(torch.cuda.device_count())
print(torch.cuda.get_device_name(1))
print(torch.cuda.current_device())
torch.cuda.set_device(0)

gpu命令cuda命令


 
                    
            
                

相关文章:

  • 2021-10-17
  • 2021-08-27
  • 2021-06-16
  • 2021-07-08
  • 2022-12-23
  • 2021-11-17
  • 2022-01-16
  • 2022-12-23
猜你喜欢
  • 2021-05-17
  • 2021-06-15
  • 2021-11-13
  • 2021-06-09
  • 2021-12-04
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案