PyTorch torch.erf 関数
torch.erfPyTorch で要素ごとに誤差関数を計算するために使用される関数です。
関数定義
torch.erf(input, *, out=None)
使用例
例
import torch
# 誤差関数の例
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])
# 誤差関数の例
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 リファレンスマニュアル