vendredi 7 août 2020

How to write torch.device('cuda' if torch.cuda.is_available() else 'cpu') as a full if else statement?

I'm a begginner to Pytorch and wanted to type this statement as a whole if else statement:-

torch.device('cuda' if torch.cuda.is_available() else 'cpu')

Can somebody help me? Thanks in Advance!!

Aucun commentaire:

Enregistrer un commentaire