mcframework.backends.validate_torch_device#
- mcframework.backends.validate_torch_device(device_type: str) None[source]#
Validate that the requested Torch device is available.
- Parameters:
- device_type
str Device type to validate (
"cpu","mps","cuda").
- device_type
- Raises:
ValueErrorIf the device type is not recognized.
RuntimeErrorIf the device is not available on this system.
Examples
>>> validate_torch_device("cpu") # Always succeeds >>> validate_torch_device("mps") # Succeeds on Apple Silicon