mindspore.ops.logaddexp2

mindspore.ops.logaddexp2(input, other)[source]

Computes the logarithm of the sum of exponentiations in base of 2 of the inputs.

\[out_i = \log_2(2^{input_i} + 2^{other_i})\]
Parameters
  • input (Tensor) – The input tensor.

  • other (Tensor) – The input tensor.

Returns

Tensor.

Supported Platforms:

Ascend GPU CPU

Examples

>>> import mindspore
>>> x1 = mindspore.tensor([1, 2, 3], mindspore.float16)
>>> x2 = mindspore.tensor(2, mindspore.float16)
>>> output = mindspore.ops.logaddexp2(x1, x2)
>>> print(output)
[2.586 3.    3.586]