Answers for "torch get device"

2

torch device

device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
Posted by: Guest on December-01-2020
1

pytorch get gpu number

torch.cuda.device_count()
Posted by: Guest on May-29-2020

Python Answers by Framework

Browse Popular Code Answers by Language