PyTorch torch.erf Function
PyTorch torch Reference Manual
torch.erfIt is a function in PyTorch used to compute the error function element-wise.
Function Definition
torch.erf(input, *, out=None)
Usage Example
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])
# 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])
Other Extensions