class_docstr: An affine posterior transform for scalarizing multi-output posteriors.
  
  For a Gaussian posterior at a single point (`q=1`) with mean `mu` and
  covariance matrix `Sigma`, this yields a single-output posterior with mean
  `weights^T * mu` and variance `weights^T Sigma w`.
  
  Example:
      Example for a model with two outcomes:
  
      >>> weights = torch.tensor([0.5, 0.25])
      >>> posterior_transform = ScalarizedPosteriorTransform(weights)
      >>> EI = ExpectedImprovement(
      ... model, best_f=0.1, posterior_transform=posterior_transform
      ... )
class_docstr_tok: ["An","affine","posterior","transform","for","scalarizing","multi-output","posteriors",".","For","a","Gaussian","posterior","at","a","single","point","(","`","q=1","`",")","with","mean","`","mu","`","and","covariance","matrix","`","Sigma","`",",","this","yields","a","single-output","posterior","with","mean","`","weights^T","*","mu","`","and","variance","`","weights^T","Sigma","w","`",".","Example",":","Example","for","a","model","with","two","outcomes",":",">",">",">","weights","=","torch.tensor","(","[","0.5",",","0.25","]",")",">",">",">","posterior_transform","=","ScalarizedPosteriorTransform","(","weights",")",">",">",">","EI","=","ExpectedImprovement","(","...","model",",","best_f=0.1",",","posterior_transform=posterior_transform","...",")"]
docstr: Compute the posterior of the affine transformation.
  
  Args:
      posterior: A posterior with the same number of outputs as the
          elements in `self.weights`.
  
  Returns:
      A single-output posterior.
code: def forward(
      self, posterior: Union[GPyTorchPosterior, PosteriorList]
  ) -> GPyTorchPosterior:
      r"""Compute the posterior of the affine transformation.
  
      Args:
          posterior: A posterior with the same number of outputs as the
              elements in `self.weights`.
  
      Returns:
          A single-output posterior.
      """
      return scalarize_posterior(
          posterior=posterior, weights=self.weights, offset=self.offset
      )
  
imports: from __future__ import annotations
  import inspect
  import warnings
  from abc import ABC, abstractmethod
  from typing import Callable, List, Optional, TYPE_CHECKING, Union
  import torch
  from botorch.exceptions.errors import BotorchTensorDimensionError, UnsupportedError
  from botorch.exceptions.warnings import InputDataWarning
  from botorch.models.model import Model
  from botorch.models.transforms.outcome import Standardize
  from botorch.posteriors.gpytorch import GPyTorchPosterior, scalarize_posterior
  from botorch.sampling import IIDNormalSampler
  from botorch.utils import apply_constraints
  from gpytorch.distributions import MultitaskMultivariateNormal, MultivariateNormal
  from linear_operator.operators.dense_linear_operator import to_linear_operator
  from torch import Tensor
  from torch.nn import Module
  from botorch.models.deterministic import DeterministicModel
label_desc: Use image node_id 3 for calling the ScalarizedPosteriorTransform obj's underlying member method code with example usage: obj.forward(posterior) and returns: scalarize_posterior