core.resolve

core.resolve(device='auto', dtype=None, *, requires_fp64=False)

Pick a device and dtype, and say no clearly when the request is impossible.

Parameters

Name Type Description Default
device Device "auto" prefers CUDA, then MPS, then CPU. Naming a device that is not present is an error rather than a silent downgrade: a run that was asked for a GPU and quietly used a CPU looks like a very slow success, and the user finds out three hours later. 'auto'
dtype DType | None None means float64, except on MPS where float64 does not exist. None
requires_fp64 bool Set from the clock’s registry entry. Overrides a float32 request, with a warning, because the alternative is returning a number that is wrong in the second decimal and saying nothing. False

Raises

Name Type Description
DeviceError The named device is unavailable, or float64 was required on hardware that cannot provide it.