default_complex_dtype#

ivy.default_complex_dtype(*, input=None, complex_dtype=None, as_native=False)[source]#
Parameters:
  • input (Optional[Union[Array, NativeArray]], default: None) – Number or array for inferring the complex dtype.

  • complex_dtype (Optional[Union[ComplexDtype, NativeDtype]], default: None) – The complex dtype to be returned.

  • as_native (bool, default: False) – Whether to return the complex dtype as native dtype.

Return type:

Union[Dtype, str, NativeDtype]

Returns:

Return complex_dtype as native or ivy dtype if provided, else if input is given, return its complex dtype, otherwise return the global default complex dtype.

Examples

>>> ivy.default_complex_dtype()
'complex64'
>>> ivy.set_default_complex_dtype(ivy.ComplexDtype("complex64"))
>>> ivy.default_complex_dtype()
'complex64'
>>> ivy.default_complex_dtype(complex_dtype=ivy.ComplexDtype("complex128"))
'complex128'
>>> ivy.default_complex_dtype(input=4294.967346)
'complex64'
>>> x = ivy.array([9.8,8.9], dtype="complex128")
>>> ivy.default_complex_dtype(input=x)
'complex128'