9 lines
308 B
Python
9 lines
308 B
Python
|
import torch as tc
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
print("cuda available :",tc.cuda.is_available())
|
||
|
print("available device count :",tc.cuda.device_count())
|
||
|
|
||
|
if tc.cuda.is_available():
|
||
|
device_index = tc.cuda.current_device()
|
||
|
print("device name:",tc.cuda.get_device_name(device_index))
|