PyTorch torch.expm1 function
PyTorch torch reference manual
torch.expm1 is a PyTorch function for computing exp(x) - 1 element-wise.
Function definition
torch.expm1(input, *, out=None)
Usage examples
Example
import
torch
exp(x) - 1 example
x
=
torch.
tensor
(
[
0
,
1
,
2
,
3
]
,
dtype
=
torch.
float32
)
result
=
torch.
expm1
(
x
)
(
result
)