mindspore.numpy.result_type
- mindspore.numpy.result_type(*arrays_and_dtypes)[源代码]
Returns the type that results from applying the type promotion rules to the arguments.
Note
The promotion rule is slightly different from original Numpy, but more like jax, due to the preference on
32-bitover64-bitdata types. Complex dtypes are not supported.- Parameters
*arrays_and_dtypes (Union[int, float, bool, list, tuple, Tensor,
mindspore.dtype, str]) – The operands of some operation whose result type is needed.- Returns
mindspore.dtype, the result type.- Raises
TypeError – If the input is not a valid data type.
- Supported Platforms:
AscendGPUCPU
Examples
>>> import mindspore.numpy as np >>> print(np.result_type('i2', np.float32, True)) Float32