dtype_utils

ODL Numerical dtypes handling

Functions

complex_dtype(dtype[, default, backend])

Returns the complex counterpart of dtype if it exists Parameters ---------- dtype : Input dtype default : Object to be returned if no complex counterpart is found for dtype. If None, an error is raised in this case. backend : If given, the result dtype will be returned in its version specific to that backend (e.g. torch.complex64), otherwise as a plain string.

real_dtype(dtype[, default, backend])

Returns the real counterpart of dtype if it exists Parameters ---------- dtype : Input dtype default : Object to be returned if no real counterpart is found for dtype, except for None, in which case an error is raised. backend : If given, the result dtype will be returned in its version specific to that backend (e.g. torch.float32), otherwise as a plain string.