class_docstr: Abstract base class for ensemble models.
  
  :meta private:
class_docstr_tok: ["Abstract","base","class","for","ensemble","models",".",":","meta","private",":"]
docstr: Compute the ensemble posterior at X.
  
  Args:
      X: A `batch_shape x q x d`-dim input tensor `X`.
      output_indices: A list of indices, corresponding to the outputs over
          which to compute the posterior. If omitted, computes the posterior
          over all model outputs.
      posterior_transform: An optional PosteriorTransform.
  
  Returns:
      An `EnsemblePosterior` object, representing `batch_shape` joint
      posteriors over `n` points and the outputs selected by `output_indices`.
docstr_tok: ["Compute","the","ensemble","posterior","at","X.","Args",":","X",":","A","`","batch_shape","x","q","x","d","`","-dim","input","tensor","`","X","`",".","output_indices",":","A","list","of","indices",",","corresponding","to","the","outputs","over","which","to","compute","the","posterior",".","If","omitted",",","computes","the","posterior","over","all","model","outputs",".","posterior_transform",":","An","optional","PosteriorTransform",".","Returns",":","An","`","EnsemblePosterior","`","object",",","representing","`","batch_shape","`","joint","posteriors","over","`","n","`","points","and","the","outputs","selected","by","`","output_indices","`","."]
code: def posterior(
      self,
      X: Tensor,
      output_indices: Optional[List[int]] = None,
      posterior_transform: Optional[PosteriorTransform] = None,
      **kwargs: Any,
  ) -> EnsemblePosterior:
      r"""Compute the ensemble posterior at X.
  
      Args:
          X: A `batch_shape x q x d`-dim input tensor `X`.
          output_indices: A list of indices, corresponding to the outputs over
              which to compute the posterior. If omitted, computes the posterior
              over all model outputs.
          posterior_transform: An optional PosteriorTransform.
  
      Returns:
          An `EnsemblePosterior` object, representing `batch_shape` joint
          posteriors over `n` points and the outputs selected by `output_indices`.
      """
      # Apply the input transforms in `eval` mode.
      self.eval()
      X = self.transform_inputs(X)
      # Note: we use a Tensor instance check so that `observation_noise = True`
      # just gets ignored. This avoids having to do a bunch of case distinctions
      # when using a ModelList.
      if isinstance(kwargs.get("observation_noise"), Tensor):
          # TODO: Consider returning an MVN here instead
          raise UnsupportedError(
              "Ensemble models do not support observation noise."
          )
      values = self._forward(X)
      # NOTE: The `outcome_transform` `untransform`s the predictions rather than the
      # `posterior` (as is done in GP models). This is more general since it works
      # even if the transform doesn't support `untransform_posterior`.
      if hasattr(self, "outcome_transform"):
          values, _ = self.outcome_transform.untransform(values)
      if output_indices is not None:
          values = values[..., output_indices]
      posterior = EnsemblePosterior(values=values)
      if posterior_transform is not None:
          return posterior_transform(posterior)
      else:
          return posterior
  
file_path: botorch/botorch/models/ensemble.py
imports: from __future__ import annotations
  from abc import ABC, abstractmethod
  from typing import Any, List, Optional
  from botorch.acquisition.objective import PosteriorTransform
  from botorch.exceptions.errors import UnsupportedError
  from botorch.models.model import Model
  from botorch.posteriors.ensemble import EnsemblePosterior
  from torch import Tensor
label_desc: Use image node_id 4 for calling the EnsembleModel obj's underlying member method code with example usage: obj.posterior(X, output_indices, posterior_transform) and returns: posterior_transform, posterior