class_docstr: Transform the `batch x (q * n_w) x m` posterior into a `batch x q x m`
  posterior of the expectation. The expectation is calculated over each
  consecutive `n_w` block of points in the posterior.
  
  This is intended for use with `InputPerturbation` or `AppendFeatures` for
  optimizing the expectation over `n_w` points. This should not be used when
  there are constraints present, since this does not take into account
  the feasibility of the objectives.
  
  Note: This is different than `ScalarizedPosteriorTransform` in that
  this operates over the q-batch dimension.
class_docstr_tok: ["Transform","the","`","batch","x","(","q","*","n_w",")","x","m","`","posterior","into","a","`","batch","x","q","x","m","`","posterior","of","the","expectation",".","The","expectation","is","calculated","over","each","consecutive","`","n_w","`","block","of","points","in","the","posterior",".","This","is","intended","for","use","with","`","InputPerturbation","`","or","`","AppendFeatures","`","for","optimizing","the","expectation","over","`","n_w","`","points",".","This","should","not","be","used","when","there","are","constraints","present",",","since","this","does","not","take","into","account","the","feasibility","of","the","objectives",".","Note",":","This","is","different","than","`","ScalarizedPosteriorTransform","`","in","that","this","operates","over","the","q-batch","dimension","."]
docstr: Evaluate the expectation of a set of outcomes.
  
  Args:
      Y: A `batch_shape x (q * n_w) x m`-dim tensor of outcomes.
  
  Returns:
      A `batch_shape x q x m`-dim tensor of expectation outcomes.
code: def evaluate(self, Y: Tensor) -> Tensor:
      r"""Evaluate the expectation of a set of outcomes.
  
      Args:
          Y: A `batch_shape x (q * n_w) x m`-dim tensor of outcomes.
  
      Returns:
          A `batch_shape x q x m`-dim tensor of expectation outcomes.
      """
      batch_shape, m = Y.shape[:-2], Y.shape[-1]
      weighted_Y = Y.view(
          *batch_shape, -1, self.n_w, m
      ) * self.weights.to(Y)
      return weighted_Y.sum(dim=-2)
  
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 2 for calling the ExpectationPosteriorTransform obj's underlying member method code with example usage: obj.evaluate(Y) and returns: weighted_Y