is_complex_dtype#

ivy.is_complex_dtype(dtype_in, /)[source]#

Determine whether the input data type is a complex dtype.

Parameters:

dtype_in (Union[Dtype, str, Array, NativeArray, Number]) – The array or data type to check

Return type:

bool

Returns:

ret – Whether or not the array or data type is of a complex dtype

Examples

>>> ivy.is_complex_dtype(ivy.ComplexDtype("complex64"))
True
>>> ivy.is_complex_dtype(ivy.Dtype("complex128"))
True
>>> ivy.is_complex_dtype(ivy.IntDtype("int64"))
False
Container.is_complex_dtype(self, /, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False)[source]#

ivy.Container instance method variant of ivy.is_complex_dtype. This method simply wraps the function, and so the docstring for ivy.is_complex_dtype also applies to this method with minimal changes.

Parameters:
  • self (ivy.Container) – The ivy.Container instance to call ivy.is_complex_dtype on.

  • key_chains (Union[List[str], Dict[str, str]]) – The key-chains to apply or not apply the method to. Default is None.

  • to_apply (bool) – Boolean indicating whether to apply the method to the key-chains. Default is False.

  • prune_unapplied (bool) – Boolean indicating whether to prune the key-chains that were not applied. Default is False.

  • map_sequences (bool) – Boolean indicating whether to map method to sequences (list, tuple). Default is False.

Return type:

Container

Returns:

ret (bool) – Boolean of whether the input is of a complex dtype.

Examples

>>> x = ivy.is_complex_dtype(ivy.complex64)
>>> print(x)
True
>>> x = ivy.is_complex_dtype(ivy.int64)
>>> print(x)
False
>>> x = ivy.is_complex_dtype(ivy.float32)
>>> print(x)
False