Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PyTorch torch.exp function

PyTorch torch.exp function


PyTorch torch reference manual 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

]

)

print

(

torch.

exp

(

x

)

)

The output is:

tensor([1.0000, 2.7183, 7.3891])


PyTorch torch reference manual PyTorch torch reference manual