torch.linalg.matrix_power
- torch.linalg.matrix_power(A, n, *, out=None) → Tensor
Computes the n-th power of a square matrix for an integer n.
Supports input of float, double, cfloat and cdouble dtypes. Also supports batches of matrices, and if
is a batch of matrices then the output has the same batch dimensions.