class_docstr: Objective that reweights samples by given weights vector.
  
  Example:
      >>> weights = torch.tensor([1.0, -1.0])
      >>> weighted_objective = WeightedMCMultiOutputObjective(weights)
      >>> samples = sampler(posterior)
      >>> objective = weighted_objective(samples)
docstr: Initialize Objective.
  
  Args:
      weights: `m'`-dim tensor of outcome weights.
      outcomes: A list of the `m'` indices that the weights should be
          applied to.
      num_outcomes: the total number of outcomes `m`
docstr_tok: ["Initialize","Objective",".","Args",":","weights",":","`","m","'","`","-dim","tensor","of","outcome","weights",".","outcomes",":","A","list","of","the","`","m","'","`","indices","that","the","weights","should","be","applied","to",".","num_outcomes",":","the","total","number","of","outcomes","`","m","`"]
code: def __init__(
      self,
      weights: Tensor,
      outcomes: Optional[List[int]] = None,
      num_outcomes: Optional[int] = None,
  ) -> None:
      r"""Initialize Objective.
  
      Args:
          weights: `m'`-dim tensor of outcome weights.
          outcomes: A list of the `m'` indices that the weights should be
              applied to.
          num_outcomes: the total number of outcomes `m`
      """
      super().__init__(outcomes=outcomes, num_outcomes=num_outcomes)
      if weights.ndim != 1:
          raise BotorchTensorDimensionError(
              f"weights must be an 1-D tensor, but got {weights.shape}."
          )
      elif outcomes is not None and weights.shape[0] != len(outcomes):
          raise BotorchTensorDimensionError(
              "weights must contain the same number of elements as outcomes, "
              f"but got {weights.numel()} weights and {len(outcomes)} outcomes."
          )
      self.register_buffer("weights", weights)
  
imports: from __future__ import annotations
  import warnings
  from abc import abstractmethod
  from typing import List, Optional
  import torch
  from botorch.acquisition.objective import GenericMCObjective, MCAcquisitionObjective
  from botorch.exceptions.errors import BotorchError, BotorchTensorDimensionError
  from botorch.models.model import Model
  from botorch.posteriors import GPyTorchPosterior
  from botorch.utils import apply_constraints
  from botorch.utils.transforms import normalize_indices
  from torch import Tensor
label_desc: Use image node_id 1 to create a new WeightedMCMultiOutputObjective object from inherited base classes: IdentityMCMultiOutputObjective with example: obj = WeightedMCMultiOutputObjective(weights, outcomes, num_outcomes)