promote_types#

ivy.promote_types(type1, type2, /, *, array_api_promotion=False)[source]#

Promote the datatypes type1 and type2, returning the data type they promote to.

Parameters:
  • type1 (Union[Dtype, NativeDtype]) – the first of the two types to promote

  • type2 (Union[Dtype, NativeDtype]) – the second of the two types to promote

  • array_api_promotion (bool, default: False) – whether to only use the array api promotion rules

Return type:

Dtype

Returns:

ret – The type that both input types promote to