dpnp.common_type
- dpnp.common_type(*arrays)[source]
Return a scalar type which is common to the input arrays.
The return type will always be an inexact (i.e. floating point or complex) scalar type, even if all the arrays are integer arrays. If one of the inputs is an integer array, the minimum precision type that is returned is the default floating point data type for the device where the input arrays are allocated.
For full documentation refer to
numpy.common_type
.- Parameters:
arrays ({dpnp.ndarray, usm_ndarray}) -- Input arrays.
- Returns:
out -- Data type object.
- Return type:
data type
See also
dpnp.dtype
Create a data type object.
Examples
>>> import dpnp as np >>> np.common_type(np.arange(2, dtype=np.float32)) numpy.float32 >>> np.common_type(np.arange(2, dtype=np.float32), np.arange(2)) numpy.float64 # may vary >>> np.common_type(np.arange(4), np.array([45, 6.j]), np.array([45.0])) numpy.complex128 # may vary