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

PyTorch torch.expm1 function

PyTorch torch.expm1 function

PyTorch torch.expm1 function


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

)

print

(

result

)

 

tensor([0.0000, 1.7183, 6.3891, 19.0855])


PyTorch torch reference manual PyTorch torch reference manual