check_device
- odl.check_device(impl: str, device: str | object) str
Checks the device argument. This checks that the device requested is available and that its compatible with the backend requested.
If successful, returns the standard string identifier of the device.
Parameters
- implstr
backend identifier
- devicestr or backend-specific device-object
Device identifier
Examples
>>> odl.check_device('numpy', 'cpu') 'cpu' >>> odl.check_device('numpy', 'anything_but_cpu') Traceback (most recent call last): ... ValueError: For numpy Backend, only devices ['cpu'] are present, but anything_but_cpu was provided.