We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 958ab92 commit cfd4324Copy full SHA for cfd4324
utils/torch_utils.py
@@ -72,7 +72,7 @@ def select_device(device='', batch_size=None):
72
73
cuda = not cpu and torch.cuda.is_available()
74
if cuda:
75
- devices = device.split(',') if device else range(torch.cuda.device_count()) # i.e. 0,1,6,7
+ devices = device.split(',') if device else '0' # range(torch.cuda.device_count()) # i.e. 0,1,6,7
76
n = len(devices) # device count
77
if n > 1 and batch_size: # check batch_size is divisible by device_count
78
assert batch_size % n == 0, f'batch-size {batch_size} not multiple of GPU count {n}'
0 commit comments