docstr: Initializes an instance of a TruncatedMultivariateNormal distribution.
  
  Let `x ~ N(0, K)` be an `n`-dimensional Gaussian random vector. This class
  represents the distribution of the truncated Multivariate normal random vector
  `x | a <= x <= b`.
  
  Args:
      loc: A mean vector for the distribution, `batch_shape x event_shape`.
      covariance_matrix: Covariance matrix distribution parameter.
      precision_matrix: Inverse covariance matrix distribution parameter.
      scale_tril: Lower triangular, square-root covariance matrix distribution
          parameter.
      bounds: A `batch_shape x event_shape x 2` tensor of strictly increasing
          bounds for `x` so that `bounds[..., 0] < bounds[..., 1]` everywhere.
      solver: A pre-solved MVNXPB instance used to approximate the log partition.
      sampler: A LinearEllipticalSliceSampler instance used for sample generation.
      validate_args: Optional argument to super().__init__.
docstr_tok: ["Initializes","an","instance","of","a","TruncatedMultivariateNormal","distribution",".","Let","`","x","~","N","(","0",",","K",")","`","be","an","`","n","`","-dimensional","Gaussian","random","vector",".","This","class","represents","the","distribution","of","the","truncated","Multivariate","normal","random","vector","`","x","|","a","<","=","x","<","=","b","`",".","Args",":","loc",":","A","mean","vector","for","the","distribution",",","`","batch_shape","x","event_shape","`",".","covariance_matrix",":","Covariance","matrix","distribution","parameter",".","precision_matrix",":","Inverse","covariance","matrix","distribution","parameter",".","scale_tril",":","Lower","triangular",",","square-root","covariance","matrix","distribution","parameter",".","bounds",":","A","`","batch_shape","x","event_shape","x","2","`","tensor","of","strictly","increasing","bounds","for","`","x","`","so","that","`","bounds","[","...",",","0","]","<","bounds","[","...",",","1","]","`","everywhere",".","solver",":","A","pre-solved","MVNXPB","instance","used","to","approximate","the","log","partition",".","sampler",":","A","LinearEllipticalSliceSampler","instance","used","for","sample","generation",".","validate_args",":","Optional","argument","to","super","(",")",".__init__","."]
code: def __init__(
      self,
      loc: Tensor,
      covariance_matrix: Optional[Tensor] = None,
      precision_matrix: Optional[Tensor] = None,
      scale_tril: Optional[Tensor] = None,
      bounds: Tensor = None,
      solver: Optional[MVNXPB] = None,
      sampler: Optional[LinearEllipticalSliceSampler] = None,
      validate_args: Optional[bool] = None,
  ):
      r"""Initializes an instance of a TruncatedMultivariateNormal distribution.
  
      Let `x ~ N(0, K)` be an `n`-dimensional Gaussian random vector. This class
      represents the distribution of the truncated Multivariate normal random vector
      `x | a <= x <= b`.
  
      Args:
          loc: A mean vector for the distribution, `batch_shape x event_shape`.
          covariance_matrix: Covariance matrix distribution parameter.
          precision_matrix: Inverse covariance matrix distribution parameter.
          scale_tril: Lower triangular, square-root covariance matrix distribution
              parameter.
          bounds: A `batch_shape x event_shape x 2` tensor of strictly increasing
              bounds for `x` so that `bounds[..., 0] < bounds[..., 1]` everywhere.
          solver: A pre-solved MVNXPB instance used to approximate the log partition.
          sampler: A LinearEllipticalSliceSampler instance used for sample generation.
          validate_args: Optional argument to super().__init__.
      """
      if bounds is None:
          raise SyntaxError("Missing required argument `bounds`.")
      elif bounds.shape[-1] != 2:
          raise ValueError(
              f"Expected bounds.shape[-1] to be 2 but bounds shape is {bounds.shape}"
          )
      elif torch.gt(*bounds.unbind(dim=-1)).any():
          raise ValueError(
              "`bounds` must be strictly increasing along dim=-1."
          )
  
      super().__init__(
          loc=loc,
          covariance_matrix=covariance_matrix,
          precision_matrix=precision_matrix,
          scale_tril=scale_tril,
          validate_args=validate_args,
      )
      self.bounds = bounds
      self._solver = solver
      self._sampler = sampler
  
file_path: botorch/botorch/utils/probability/truncated_multivariate_normal.py
imports: from __future__ import annotations
  from typing import Optional, Sequence
  import torch
  from botorch.utils.probability.lin_ess import LinearEllipticalSliceSampler
  from botorch.utils.probability.mvnxpb import MVNXPB
  from botorch.utils.probability.utils import get_constants_like
  from torch import Tensor
  from torch.distributions.multivariate_normal import MultivariateNormal
label_desc: Use image node_id 1 to create a new TruncatedMultivariateNormal object from inherited base classes: MultivariateNormal with example: obj = TruncatedMultivariateNormal(loc, covariance_matrix, precision_matrix, scale_tril, bounds, solver, sampler, validate_args)