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

PyTorch torch.erf function

PyTorch torch.erf function

PyTorch torch.erf function


PyTorch torch reference manual PyTorch torch reference manual

torch.erf is a PyTorch function for computing the error function element-wise.

Function definition

torch.erf(input, *, out=None)


Usage examples

Example

import

torch

Error function example

x

=

torch.

tensor

(

[

0

,

0.5

,

1.0

,

2.0

]

,

dtype

=

torch.

float32

)

result

=

torch.

erf

(

x

)

print

(

result

)

 

tensor([0.0000, 0.5205, 0.8427, 0.9953])


PyTorch torch reference manual PyTorch torch reference manual