Fonction torch.matrix_exp de PyTorch


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

torch.matrix_expest une fonction de PyTorch utilisée pour calculer l'exponentielle matricielle.

Définition de fonction

torch.matrix_exp(input)

Exemple d'utilisation

Exemple

import torch

# Créer une matrice carrée
A = torch.tensor([[1.0, 0.0], [0.0, 1.0]])

# Calculer l'exponentielle matricielle
exp_A = torch.matrix_exp(A)
print("Exponentielle matricielle :")
print(exp_A)

Le résultat de sortie est:

矩阵指数:
tensor([[2.7183, 0.0000],
        [0.0000, 2.7183]])

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

Autres extensions