class_docstr: A generic transformation of a posterior (implicitly represented).
class_docstr_tok: ["A","generic","transformation","of","a","posterior","(","implicitly","represented",")","."]
docstr: An implicitly represented transformed posterior.
  
  Args:
      posterior: The posterior object to be transformed.
      sample_transform: A callable applying a sample-level transform to a
          `sample_shape x batch_shape x q x m`-dim tensor of samples from
          the original posterior, returning a tensor of samples of the
          same shape.
      mean_transform: A callable transforming a 2-tuple of mean and
          variance (both of shape `batch_shape x m x o`) of the original
          posterior to the mean of the transformed posterior.
      variance_transform: A callable transforming a 2-tuple of mean and
          variance (both of shape `batch_shape x m x o`) of the original
          posterior to a variance of the transformed posterior.
docstr_tok: ["An","implicitly","represented","transformed","posterior",".","Args",":","posterior",":","The","posterior","object","to","be","transformed",".","sample_transform",":","A","callable","applying","a","sample-level","transform","to","a","`","sample_shape","x","batch_shape","x","q","x","m","`","-dim","tensor","of","samples","from","the","original","posterior",",","returning","a","tensor","of","samples","of","the","same","shape",".","mean_transform",":","A","callable","transforming","a","2-tuple","of","mean","and","variance","(","both","of","shape","`","batch_shape","x","m","x","o","`",")","of","the","original","posterior","to","the","mean","of","the","transformed","posterior",".","variance_transform",":","A","callable","transforming","a","2-tuple","of","mean","and","variance","(","both","of","shape","`","batch_shape","x","m","x","o","`",")","of","the","original","posterior","to","a","variance","of","the","transformed","posterior","."]
code: def __init__(
      self,
      posterior: Posterior,
      sample_transform: Callable[[Tensor], Tensor],
      mean_transform: Optional[
          Callable[[Tensor, Tensor], Tensor]
      ] = None,
      variance_transform: Optional[
          Callable[[Tensor, Tensor], Tensor]
      ] = None,
  ) -> None:
      r"""An implicitly represented transformed posterior.
  
      Args:
          posterior: The posterior object to be transformed.
          sample_transform: A callable applying a sample-level transform to a
              `sample_shape x batch_shape x q x m`-dim tensor of samples from
              the original posterior, returning a tensor of samples of the
              same shape.
          mean_transform: A callable transforming a 2-tuple of mean and
              variance (both of shape `batch_shape x m x o`) of the original
              posterior to the mean of the transformed posterior.
          variance_transform: A callable transforming a 2-tuple of mean and
              variance (both of shape `batch_shape x m x o`) of the original
              posterior to a variance of the transformed posterior.
      """
      self._posterior = posterior
      self._sample_transform = sample_transform
      self._mean_transform = mean_transform
      self._variance_transform = variance_transform
  
file_path: botorch/botorch/posteriors/transformed.py
imports: from __future__ import annotations
  from typing import Callable, Optional, Tuple
  import torch
  from botorch.posteriors.posterior import Posterior
  from torch import Tensor
label_desc: Use image node_id 1 to create a new TransformedPosterior object from inherited base classes: Posterior with example: obj = TransformedPosterior(posterior, sample_transform, mean_transform, variance_transform)