Validate the precision and device combination.
(precision: Precision, device: Device)
| 38 | |
| 39 | |
| 40 | def _validate_precision(precision: Precision, device: Device): |
| 41 | """Validate the precision and device combination.""" |
| 42 | if isinstance(device, DeviceCPU) and precision != Precision.FP32: |
| 43 | raise ValueError(f'{precision} is not supported for CPU training.') |
| 44 | |
| 45 | |
| 46 | @contextlib.contextmanager |
no outgoing calls
no test coverage detected