code: def pivoted_cholesky(
      input: Anysor,
      rank: int,
      error_tol: Optional[float] = None,
      return_pivots: bool = False,
  ) -> Union[Tensor, Tuple[Tensor, Tensor]]:
      r"""
      Performs a partial pivoted Cholesky factorization of a positive definite matrix (or batch of matrices).
      :math:`\mathbf L \mathbf L^\top = \mathbf A`.
      The partial pivoted Cholesky factor :math:`\mathbf L \in \mathbb R^{N \times \text{rank}}`
      forms a low rank approximation to the LinearOperator.
  
      The pivots are selected greedily, correspoading to the maximum diagonal element in the
      residual after each Cholesky iteration. See `Harbrecht et al., 2012`_.
  
      :param input: The matrix (or batch of matrices) :math:`\mathbf A` (... x N x N).
      :param rank: The size of the partial pivoted Cholesky factor.
      :param error_tol: Defines an optional stopping criterion.
          If the residual of the factorization is less than :attr:`error_tol`, then the
          factorization will exit early. This will result in a :math:`\leq \text{ rank}` factor.
      :param return_pivots: Whether or not to return the pivots alongside
          the partial pivoted Cholesky factor.
      :return: The `... x N x rank` factor (and optionally the `... x N` pivots if :attr:`return_pivots` is True).
  
      .. _Harbrecht et al., 2012:
          https://www.sciencedirect.com/science/article/pii/S0168927411001814
      """
      return linear_operator.pivoted_cholesky(
          input=input, rank=rank, return_pivots=return_pivots
      )
  
imports: from typing import Optional, Tuple, Union
  import linear_operator
  import torch
  from linear_operator import LinearOperator
  from torch import Tensor
  from .None import beta_features, distributions, kernels, lazy, likelihoods, means, metrics, mlls, models, optim, priors, settings, utils, variational
  from .functions import inv_matmul, log_normal_cdf, logdet, matmul
  from .lazy import cat, delazify, lazify
  from .mlls import ExactMarginalLogLikelihood
  from .module import Module
label_desc: Use image node_id 7 for calling a global function with example usage: pivoted_cholesky(input, rank, error_tol, return_pivots) and returns: linear_operator