()
| 42 | # Parses the config from the command line arguments |
| 43 | def parse_args(cmd=None, description=None): |
| 44 | def get_default_device(): |
| 45 | if torch.cuda.is_available(): |
| 46 | return 'cuda' |
| 47 | elif torch.backends.mps.is_available(): |
| 48 | return 'mps' |
| 49 | else: |
| 50 | return 'cpu' |
| 51 | |
| 52 | if cmd is None: |
| 53 | cmd, _ = os.path.splitext(os.path.basename(sys.argv[0])) |