File size: 100 Bytes
a18d54c
 
 
 
 
 
 
1
2
3
4
5
6
7
import torch

def get_device_id():
    if torch.cuda.is_available():
        return 0

    return -1