class_docstr: Objective transforming the multi-output posterior samples to samples
  of a multi-output risk measure.
  
  The risk measure is calculated over joint q-batch samples from the posterior.
  If the q-batch includes samples corresponding to multiple inputs, it is assumed
  that first `n_w` samples correspond to first input, second `n_w` samples
  correspond to second input, etc.
  
  :meta private:
docstr: Prepare samples for risk measure calculations by scaling and
  separating out the q-batch dimension.
  
  Args:
      samples: A `sample_shape x batch_shape x (q * n_w) x m`-dim tensor of
          posterior samples. The q-batches should be ordered so that each
          `n_w` block of samples correspond to the same input.
  
  Returns:
      A `sample_shape x batch_shape x q x n_w x m'`-dim tensor of
      prepared samples.
docstr_tok: ["Prepare","samples","for","risk","measure","calculations","by","scaling","and","separating","out","the","q-batch","dimension",".","Args",":","samples",":","A","`","sample_shape","x","batch_shape","x","(","q","*","n_w",")","x","m","`","-dim","tensor","of","posterior","samples",".","The","q-batches","should","be","ordered","so","that","each","`","n_w","`","block","of","samples","correspond","to","the","same","input",".","Returns",":","A","`","sample_shape","x","batch_shape","x","q","x","n_w","x","m","'","`","-dim","tensor","of","prepared","samples","."]
code: def _prepare_samples(self, samples: Tensor) -> Tensor:
      r"""Prepare samples for risk measure calculations by scaling and
      separating out the q-batch dimension.
  
      Args:
          samples: A `sample_shape x batch_shape x (q * n_w) x m`-dim tensor of
              posterior samples. The q-batches should be ordered so that each
              `n_w` block of samples correspond to the same input.
  
      Returns:
          A `sample_shape x batch_shape x q x n_w x m'`-dim tensor of
          prepared samples.
      """
      samples = self.preprocessing_function(samples)
      return samples.view(
          *samples.shape[:-2], -1, self.n_w, samples.shape[-1]
      )
  
imports: import warnings
  from abc import ABC, abstractmethod
  from math import ceil
  from typing import Callable, List, Optional, Union
  import torch
  from botorch.acquisition.multi_objective.objective import IdentityMCMultiOutputObjective, MCMultiOutputObjective
  from botorch.acquisition.risk_measures import CVaR, RiskMeasureMCObjective, VaR
  from botorch.exceptions.errors import UnsupportedError
  from botorch.exceptions.warnings import BotorchWarning
  from botorch.models.model import Model
  from botorch.utils.multi_objective.pareto import is_non_dominated
  from botorch.utils.transforms import normalize
  from torch import Tensor
label_desc: Use image node_id 2 for calling the MultiOutputRiskMeasureMCObjective obj's underlying member method code with example usage: obj._prepare_samples(samples) and returns: samples