| 1 | def add_device_arguments(parser): |
| 2 | parser.add_argument('--use-cuda', default=True, type=lambda x: (str(x).lower() == 'true'), |
| 3 | help='if this is set to True, will use cuda to train') |
| 4 | parser.add_argument('--cuda-id', type=int, default=0, metavar='N', |
| 5 | help='cuda index, if the instance has multiple GPUs.') |
| 6 | parser.add_argument('--cuda-num', type=int, default=1, metavar='N', |
| 7 | help='number of GPUs, if the instance has multiple GPUs.') |
| 8 | parser.add_argument('--debug-mem', default=True, type=lambda x: (str(x).lower() == 'true'), |
| 9 | help='if this is set to True, we will print some memory stats.') |
| 10 | |
| 11 | |
| 12 | def add_torch_distributed_arguments(parser): |