PyTorch torch.logaddexp2 function
PyTorch torch reference manual
torch.logaddexp2 is a function in PyTorch used to compute log2(2^x + 2^y).
Function definition
torch.logaddexp2(input, other)
Usage examples
Example
import
torch
Compute log2(2^x + 2^y)
x
=
torch.
tensor
(
[
1.0
,
2.0
]
)
y
=
torch.
tensor
(
[
3.0
,
4.0
]
)
z
=
torch.
logaddexp2
(
x
,
y
)
(
"logaddexp2:"
,
z
)
The output is:
logaddexp2: tensor([3.0875, 4.0236])