PyTorch torch.exp function
PyTorch torch reference manual
torch.exp is a PyTorch function for computing the element-wise exponential function.
Function definition
torch.exp(input, out=None)
Usage examples
Example
import
torch
x
=
torch.
tensor
(
[
0
,
1
,
2
]
)
(
torch.
exp
(
x
)
)
The output is:
tensor([1.0000, 2.7183, 7.3891])