MCPcopy Create free account
hub / github.com/LAMDA-CL/CVPR22-Fact / set_gpu

Function set_gpu

utils.py:31–36  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

29
30
31def set_gpu(args):
32 gpu_list = [int(x) for x in args.gpu.split(',')]
33 print('use gpu:', gpu_list)
34 os.environ['CUDA_DEVICE_ORDER'] = 'PCI_BUS_ID'
35 os.environ['CUDA_VISIBLE_DEVICES'] = args.gpu
36 return gpu_list.__len__()
37
38
39def ensure_path(path):

Callers 1

train.pyFile · 0.85

Calls 1

__len__Method · 0.45

Tested by

no test coverage detected