mindspore.ops.logaddexp2
- mindspore.ops.logaddexp2(x1, x2)[source]
Computes the logarithm of the sum of exponentiations in base of 2 of the inputs.
\[out_i = log_2(2^{x1_i} + 2^{x2_i})\]- Parameters
- Returns
Tensor.
- Raises
TypeError – If x1, x2 is not a Tensor.
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> x1 = Tensor(np.array([2, 4, 8]).astype(np.float16)) >>> x2 = Tensor(np.array([2]).astype(np.float16)) >>> output = ops.logaddexp2(x1, x2) >>> print(output) [3. 4.32 8.02]