class_docstr: Linear objective constructed from a weight tensor.
  
  For input `samples` and `mc_obj = LinearMCObjective(weights)`, this produces
  `mc_obj(samples) = sum_{i} weights[i] * samples[..., i]`
  
  Example:
      Example for a model with two outcomes:
  
      >>> weights = torch.tensor([0.75, 0.25])
      >>> linear_objective = LinearMCObjective(weights)
      >>> samples = sampler(posterior)
      >>> objective = linear_objective(samples)
class_docstr_tok: ["Linear","objective","constructed","from","a","weight","tensor",".","For","input","`","samples","`","and","`","mc_obj","=","LinearMCObjective","(","weights",")","`",",","this","produces","`","mc_obj","(","samples",")","=","sum_","{","i","}","weights","[","i","]","*","samples","[","...",",","i","]","`","Example",":","Example","for","a","model","with","two","outcomes",":",">",">",">","weights","=","torch.tensor","(","[","0.75",",","0.25","]",")",">",">",">","linear_objective","=","LinearMCObjective","(","weights",")",">",">",">","samples","=","sampler","(","posterior",")",">",">",">","objective","=","linear_objective","(","samples",")"]
docstr: Args:
      weights: A one-dimensional tensor with `m` elements representing the
          linear weights on the outputs.
code: def __init__(self, weights: Tensor) -> None:
      r"""
      Args:
          weights: A one-dimensional tensor with `m` elements representing the
              linear weights on the outputs.
      """
      super().__init__()
      if weights.dim() != 1:
          raise ValueError("weights must be a one-dimensional tensor.")
      self.register_buffer("weights", weights)
  
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 1 to create a new LinearMCObjective object from inherited base classes: MCAcquisitionObjective with example: obj = LinearMCObjective(weights)