Fonction torch.expm1 de PyTorch

Fonction torch.expm1 de PyTorch


Pytorch torch 参考手册Manuel de référence Pytorch torch

torch.expm1Il s'agit d'une fonction de PyTorch utilisée pour calculer exp(x) - 1 élément par élément.

Définition de fonction

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

Exemple d'utilisation

Exemple

import torch

# Exemple de exp(x) - 1
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 参考手册Manuel de référence Pytorch torch

Autres extensions