class_docstr: An algorithm for approximating Gaussian probabilities `P(X \in bounds)`, where
  `X ~ N(0, covariance_matrix)`.
class_docstr_tok: ["An","algorithm","for","approximating","Gaussian","probabilities","`","P","(","X","\\in","bounds",")","`",",","where","`","X","~","N","(","0",",","covariance_matrix",")","`","."]
docstr: Initializes an MVNXPB instance.
  
  Args:
      covariance_matrix: Covariance matrices of shape `batch_shape x [n, n]`.
      bounds: Tensor of lower and upper bounds, `batch_shape x [n, 2]`. These
          bounds are standardized internally and clipped to STANDARDIZED_RANGE.
docstr_tok: ["Initializes","an","MVNXPB","instance",".","Args",":","covariance_matrix",":","Covariance","matrices","of","shape","`","batch_shape","x","[","n",",","n","]","`",".","bounds",":","Tensor","of","lower","and","upper","bounds",",","`","batch_shape","x","[","n",",","2","]","`",".","These","bounds","are","standardized","internally","and","clipped","to","STANDARDIZED_RANGE","."]
code: def __init__(self, covariance_matrix: Tensor, bounds: Tensor) -> None:
      r"""Initializes an MVNXPB instance.
  
      Args:
          covariance_matrix: Covariance matrices of shape `batch_shape x [n, n]`.
          bounds: Tensor of lower and upper bounds, `batch_shape x [n, 2]`. These
              bounds are standardized internally and clipped to STANDARDIZED_RANGE.
      """
      *batch_shape, _, n = covariance_matrix.shape
      device = covariance_matrix.device
      dtype = covariance_matrix.dtype
      perm = (
          torch.arange(0, n, device=device)
          .expand(*batch_shape, n)
          .contiguous()
      )
  
      # Standardize covariance matrices and bounds
      var = covariance_matrix.diagonal(dim1=-2, dim2=-1).unsqueeze(-1)
      std = var.sqrt()
      istd = var.rsqrt()
      matrix = istd * covariance_matrix * istd.transpose(-1, -2)
  
      # Clip first to avoid differentiating through `istd * inf`
      bounds = istd * bounds.clip(
          *(std * lim for lim in STANDARDIZED_RANGE)
      )
  
      # Initialize partial pivoted Cholesky
      piv_chol = PivotedCholesky(
          step=0,
          perm=perm.clone(),
          diag=std.squeeze(-1).clone(),
          tril=matrix.tril(),
      )
      self.step = 0
      self.perm = perm
      self.bounds = bounds
      self.piv_chol = piv_chol
      self.plug_ins = torch.full(
          batch_shape + [n], float("nan"), device=device, dtype=dtype
      )
      self.log_prob = torch.zeros(
          batch_shape, device=device, dtype=dtype
      )
      self.log_prob_extra: Optional[Tensor] = None
  
imports: from __future__ import annotations
  from typing import Any, Optional, TypedDict
  from warnings import warn
  import torch
  from botorch.utils.probability.bvn import bvn, bvnmom
  from botorch.utils.probability.linalg import augment_cholesky, block_matrix_concat, PivotedCholesky
  from botorch.utils.probability.utils import case_dispatcher, get_constants_like, ndtr, phi, STANDARDIZED_RANGE, swap_along_dim_
  from botorch.utils.safe_math import log, mul
  from linear_operator.utils.cholesky import psd_safe_cholesky
  from linear_operator.utils.errors import NotPSDError
  from torch import LongTensor, Tensor
  from torch.nn.functional import pad
label_desc: Use image node_id 1 to create a new MVNXPB object  with example: obj = MVNXPB(covariance_matrix, bounds)