class_docstr: Abstract base class for BoTorch models.
  
  The `Model` base class cannot be used directly; it only defines an API for other
  BoTorch models.
  
  `Model` subclasses `torch.nn.Module`. While a `Module` is most typically
  encountered as a representation of a neural network layer, it can be used more
  generally: see
  `documentation <https://pytorch.org/tutorials/beginner/examples_nn/polynomial_module.html>`_
  on custom NN Modules.
  
  `Module` provides several pieces of useful functionality: A `Model`'s attributes of
  `Tensor` or `Module` type are automatically registered so they can be moved and/or
  cast with the `to` method, automatically differentiated, and used with CUDA.
  
  Attributes:
      _has_transformed_inputs: A boolean denoting whether `train_inputs` are currently
          stored as transformed or not.
      _original_train_inputs: A Tensor storing the original train inputs for use in
          `_revert_to_original_inputs`. Note that this is necessary since
          transform / untransform cycle introduces numerical errors which lead
          to upstream errors during training.
      _is_fully_bayesian: Returns `True` if this is a fully Bayesian model.
      _is_ensemble: Returns `True` if this model consists of multiple models
          that are stored in an additional batch dimension. This is true for the fully
          Bayesian models.
class_docstr_tok: ["Abstract","base","class","for","BoTorch","models",".","The","`","Model","`","base","class","can","not","be","used","directly",";","it","only","defines","an","API","for","other","BoTorch","models",".","`","Model","`","subclasses","`","torch.nn.Module","`",".","While","a","`","Module","`","is","most","typically","encountered","as","a","representation","of","a","neural","network","layer",",","it","can","be","used","more","generally",":","see","`","documentation","<","https",":","\/\/pytorch.org\/tutorials\/beginner\/examples_nn\/polynomial_module.html",">","`","_","on","custom","NN","Modules",".","`","Module","`","provides","several","pieces","of","useful","functionality",":","A","`","Model","`","'s","attributes","of","`","Tensor","`","or","`","Module","`","type","are","automatically","registered","so","they","can","be","moved","and\/or","cast","with","the","`","to","`","method",",","automatically","differentiated",",","and","used","with","CUDA",".","Attributes",":","_has_transformed_inputs",":","A","boolean","denoting","whether","`","train_inputs","`","are","currently","stored","as","transformed","or","not",".","_original_train_inputs",":","A","Tensor","storing","the","original","train","inputs","for","use","in","`","_revert_to_original_inputs","`",".","Note","that","this","is","necessary","since","transform","\/","untransform","cycle","introduces","numerical","errors","which","lead","to","upstream","errors","during","training",".","_is_fully_bayesian",":","Returns","`","True","`","if","this","is","a","fully","Bayesian","model",".","_is_ensemble",":","Returns","`","True","`","if","this","model","consists","of","multiple","models","that","are","stored","in","an","additional","batch","dimension",".","This","is","true","for","the","fully","Bayesian","models","."]
docstr: Condition the model on new observations.
  
  Args:
      X: A `batch_shape x n' x d`-dim Tensor, where `d` is the dimension of
          the feature space, `n'` is the number of points per batch, and
          `batch_shape` is the batch shape (must be compatible with the
          batch shape of the model).
      Y: A `batch_shape' x n' x m`-dim Tensor, where `m` is the number of
          model outputs, `n'` is the number of points per batch, and
          `batch_shape'` is the batch shape of the observations.
          `batch_shape'` must be broadcastable to `batch_shape` using
          standard broadcasting semantics. If `Y` has fewer batch dimensions
          than `X`, it is assumed that the missing batch dimensions are
          the same for all `Y`.
  
  Returns:
      A `Model` object of the same type, representing the original model
      conditioned on the new observations `(X, Y)` (and possibly noise
      observations passed in via kwargs).
code: def condition_on_observations(
      self, X: Tensor, Y: Tensor, **kwargs: Any
  ) -> Model:
      r"""Condition the model on new observations.
  
      Args:
          X: A `batch_shape x n' x d`-dim Tensor, where `d` is the dimension of
              the feature space, `n'` is the number of points per batch, and
              `batch_shape` is the batch shape (must be compatible with the
              batch shape of the model).
          Y: A `batch_shape' x n' x m`-dim Tensor, where `m` is the number of
              model outputs, `n'` is the number of points per batch, and
              `batch_shape'` is the batch shape of the observations.
              `batch_shape'` must be broadcastable to `batch_shape` using
              standard broadcasting semantics. If `Y` has fewer batch dimensions
              than `X`, it is assumed that the missing batch dimensions are
              the same for all `Y`.
  
      Returns:
          A `Model` object of the same type, representing the original model
          conditioned on the new observations `(X, Y)` (and possibly noise
          observations passed in via kwargs).
      """
      raise NotImplementedError(
          f"`condition_on_observations` not implemented for {self.__class__.__name__}"
      )
  
imports: from __future__ import annotations
  import warnings
  from abc import ABC, abstractmethod
  from collections import defaultdict
  from copy import deepcopy
  from typing import Any, Callable, Dict, List, Mapping, Optional, Set, TYPE_CHECKING, TypeVar, Union
  import numpy
  import torch
  from botorch import settings
  from botorch.exceptions.errors import BotorchTensorDimensionError, DeprecationError, InputDataError
  from botorch.logging import shape_to_str
  from botorch.models.utils.assorted import fantasize
  from botorch.posteriors import Posterior, PosteriorList
  from botorch.sampling.base import MCSampler
  from botorch.sampling.list_sampler import ListSampler
  from botorch.utils.datasets import SupervisedDataset
  from botorch.utils.transforms import is_fully_bayesian
  from gpytorch.likelihoods.gaussian_likelihood import FixedNoiseGaussianLikelihood
  from torch import Tensor
  from torch.nn import Module, ModuleDict, ModuleList
label_desc: Use image node_id 5 for calling the Model obj's underlying member method code with example usage: obj.condition_on_observations(X, Y) without return types