()
| 78 | |
| 79 | @lru_cache(maxsize=None) |
| 80 | def get_current_device_name(): |
| 81 | import torch |
| 82 | |
| 83 | if torch.cuda.is_available(): |
| 84 | device = torch.cuda.current_device() |
| 85 | gpu_name = torch.cuda.get_device_name(device).replace(" ", "_") |
| 86 | return gpu_name |
| 87 | else: |
| 88 | return None |
| 89 | |
| 90 | |
| 91 | @lru_cache(maxsize=None) |
no outgoing calls
no test coverage detected