get_promote_dtypes

get_promote_dtypes#

class saiunit.math.get_promote_dtypes(*args, **kwargs)#

Promote the data types of the inputs to a common type.

Parameters:

*args (Union[saiunit.Quantity, Array, ndarray, number, bool]) – The arrays whose dtypes should be promoted.

Returns:

promoted – The promoted common dtype.

Return type:

Union[saiunit.Quantity, Array, Sequence[Union[saiunit.Quantity, Array]]]

Examples

>>> import saiunit as u
>>> import jax.numpy as jnp
>>> u.math.get_promote_dtypes(jnp.float32, jnp.int32)
dtype('float32')