Return the accelerator for the current process. If the accelerator is not initialized, it will be initialized to the default accelerator type. Returns: the accelerator for the current process.
()
| 58 | |
| 59 | |
| 60 | def get_accelerator() -> BaseAccelerator: |
| 61 | """ |
| 62 | Return the accelerator for the current process. If the accelerator is not initialized, it will be initialized |
| 63 | to the default accelerator type. |
| 64 | |
| 65 | Returns: the accelerator for the current process. |
| 66 | """ |
| 67 | global _ACCELERATOR |
| 68 | |
| 69 | if _ACCELERATOR is None: |
| 70 | auto_set_accelerator() |
| 71 | return _ACCELERATOR |
searching dependent graphs…