ner-study/cuda_test.py

9 lines
308 B
Python
Raw Permalink Normal View History

2022-02-13 17:34:03 +09:00
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))