BhavaishKumar112 commited on
Commit
a16b6d3
·
verified ·
1 Parent(s): 8039c0d

Create device/get_device_id.py

Browse files
Files changed (1) hide show
  1. device/get_device_id.py +7 -0
device/get_device_id.py ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ import torch
2
+
3
+ def get_device_id():
4
+ if torch.cuda.is_available():
5
+ return 0
6
+
7
+ return -1