default_uint_dtype#

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

  • uint_dtype (Optional[Union[UintDtype, NativeDtype]], default: None) – The uint dtype to be returned.

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

Return type:

Union[UintDtype, NativeDtype]

Returns:

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

Examples

>>> ivy.set_default_uint_dtype(ivy.UintDtype("uint16"))
>>> ivy.default_uint_dtype()
'uint16'
>>> ivy.default_uint_dtype(input=4294967346)
'uint64'
>>> ivy.default_uint_dtype(uint_dtype=ivy.UintDtype("uint8"))
'uint8'
>>> x = ivy.array([9,8], dtype="uint32")
>>> ivy.default_uint_dtype(input=x)
'uint32'