MCPcopy Create free account
hub / github.com/HobbitLong/PyContrast / main

Function main

pycontrast/main_contrast.py:18–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16
17
18def main():
19 args = TrainOptions().parse()
20
21 args.distributed = args.world_size > 1 or args.multiprocessing_distributed
22 ngpus_per_node = torch.cuda.device_count()
23
24 if args.multiprocessing_distributed:
25 args.world_size = ngpus_per_node * args.world_size
26 mp.spawn(main_worker, nprocs=ngpus_per_node, args=(ngpus_per_node, args))
27 else:
28 raise NotImplementedError('Currently only DDP training')
29
30
31def main_worker(gpu, ngpus_per_node, args):

Callers 1

main_contrast.pyFile · 0.70

Calls 2

TrainOptionsClass · 0.90
parseMethod · 0.80

Tested by

no test coverage detected