-
Notifications
You must be signed in to change notification settings - Fork 2
/
torchtest.py
32 lines (26 loc) · 947 Bytes
/
torchtest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import sys
import platform
import numpy as np
import torch
import torchvision
import fastai.utils
def check():
print('pytorch version', torch.__version__)
if torchvision is None:
print('torchvision not found.')
else:
print('torchvision version', torchvision.__version__, '\n')
print('CPU:', platform.processor(), '\n')
if torch.cuda.is_available():
num_gpus = torch.cuda.device_count()
for ii in range(num_gpus):
prop = torch.cuda.get_device_properties(ii)
print(
'CUDA device {ii}: {prop.name}\nMemory: {prop.total_memory}\nMulti processor count: {prop.multi_processor_count}\nMajor version: {prop.major}, minor version {prop.minor}\n'
.format(ii=ii, prop=prop))
else:
print('No CUDA devices')
fastai.utils.check_perf()
print(f'numpy seed is {np.random.get_state()[1][0]}')
if __name__ == '__main__':
check()