code: def inv_quad_logdet(
      input: Anysor,
      inv_quad_rhs: Optional[Tensor] = None,
      logdet: bool = False,
      reduce_inv_quad: bool = True,
  ) -> Tuple[Tensor, Tensor]:
      r"""
      Calls both :func:`inv_quad_logdet` and :func:`logdet` on a positive definite matrix (or batch) :math:`\mathbf A`.
      However, calling this method is far more efficient and stable than calling each method independently.
  
      :param input: :math:`\mathbf A` - the positive definite matrix (... X N X N)
      :param inv_quad_rhs: :math:`\mathbf R` - the right hand sides of the inverse quadratic term (... x N x M)
      :param logdet: Whether or not to compute the
          logdet term :math:`\log \vert \mathbf A \vert`.
      :param reduce_inv_quad: Whether to compute
          :math:`\text{tr}\left( \mathbf R^\top \mathbf A^{-1} \mathbf R \right)`
          or :math:`\text{diag}\left( \mathbf R^\top \mathbf A^{-1} \mathbf R \right)`.
      :returns: The inverse quadratic term (or None), and the logdet term (or None).
          If `reduce_inv_quad=True`, the inverse quadratic term is of shape (...). Otherwise, it is (... x M).
      """
      return linear_operator.inv_quad_logdet(
          input=input,
          inv_quad_rhs=inv_quad_rhs,
          logdet=logdet,
          reduce_inv_quad=reduce_inv_quad,
      )
  
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 6 for calling a global function with example usage: inv_quad_logdet(input, inv_quad_rhs, logdet, reduce_inv_quad) and returns: linear_operator