import torch


def sym_invm(x: torch.Tensor) -> torch.Tensor:
    """Symmetric matrix inverse.

    Parameters
    ----------
    x : torch.Tensor
        symmetric matrix

    Returns
    -------
    torch.Tensor
        :math:`x^{-1}`

    Notes
    -----
    Naive implementation using `torch.matrix_power` seems to be fast enough
    """
    return torch.matrix_power(x, -1)