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_typestr

Device type to validate ("cpu", "mps", "cuda").

Raises:
ValueError

If the device type is not recognized.

RuntimeError

If the device is not available on this system.

Examples

>>> validate_torch_device("cpu")  # Always succeeds
>>> validate_torch_device("mps")  # Succeeds on Apple Silicon