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