complex_dtype

odl.core.util.dtype_utils.complex_dtype(dtype: str | Number | xp.dtype, default=None, backend: ArrayBackend | None = None) str[source]

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.