class_docstr: Objective transforming the posterior samples to samples of a 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.
  
  The risk measures are commonly defined for minimization by considering the
  upper tail of the distribution, i.e., treating larger values as being undesirable.
  BoTorch by default assumes a maximization objective, so the default behavior here
  is to calculate the risk measures w.r.t. the lower tail of the distribution.
  This can be changed by passing a preprocessing function with
  `weights=torch.tensor([-1.0])`.
  
  :meta private:
class_docstr_tok: ["Objective","transforming","the","posterior","samples","to","samples","of","a","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",".","The","risk","measures","are","commonly","defined","for","minimization","by","considering","the","upper","tail","of","the","distribution",",","i.e.",",","treating","larger","values","as","being","undesirable",".","BoTorch","by","default","assumes","a","maximization","objective",",","so","the","default","behavior","here","is","to","calculate","the","risk","measures","w.r.t",".","the","lower","tail","of","the","distribution",".","This","can","be","changed","by","passing","a","preprocessing","function","with","`","weights=torch.tensor","(","[","-1.0","]",")","`",".",":","meta","private",":"]
docstr: Calculate the risk measure corresponding to the given samples.
  
  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.
      X: A `batch_shape x q x d`-dim tensor of inputs. Ignored.
  
  Returns:
      A `sample_shape x batch_shape x q`-dim tensor of risk measure samples.
docstr_tok: ["Calculate","the","risk","measure","corresponding","to","the","given","samples",".","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",".","X",":","A","`","batch_shape","x","q","x","d","`","-dim","tensor","of","inputs",".","Ignored",".","Returns",":","A","`","sample_shape","x","batch_shape","x","q","`","-dim","tensor","of","risk","measure","samples","."]
code: def forward(
      self, samples: Tensor, X: Optional[Tensor] = None
  ) -> Tensor:
      r"""Calculate the risk measure corresponding to the given samples.
  
      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.
          X: A `batch_shape x q x d`-dim tensor of inputs. Ignored.
  
      Returns:
          A `sample_shape x batch_shape x q`-dim tensor of risk measure samples.
      """
      pass
  
imports: from abc import ABC, abstractmethod
  from math import ceil
  from typing import Callable, Optional
  import torch
  from botorch.acquisition.multi_objective.objective import IdentityMCMultiOutputObjective
  from botorch.acquisition.objective import IdentityMCObjective, MCAcquisitionObjective
  from torch import Tensor
label_desc: Use image node_id 3 for calling the RiskMeasureMCObjective obj's underlying member method code with example usage: obj.forward(samples, X) without return types