(device: str)
| 912 | # These are callables which return boolean behaviour flags and can be used to specify some |
| 913 | # device agnostic alternative where the feature is unsupported. |
| 914 | def backend_supports_training(device: str): |
| 915 | if not is_torch_available(): |
| 916 | return False |
| 917 | |
| 918 | if device not in BACKEND_SUPPORTS_TRAINING: |
| 919 | device = "default" |
| 920 | |
| 921 | return BACKEND_SUPPORTS_TRAINING[device] |
| 922 | |
| 923 | |
| 924 | # Guard for when Torch is not available |
no test coverage detected