code: def test_chebyshev_objective(self):
      # Check that the objective is destroyed on setters.
      mars = MARS(
          alpha=0.5,
          n_w=3,
          chebyshev_weights=[0.5, 0.5],
          baseline_Y=torch.empty(0, 2),
      )
      self.assertIsNone(mars._chebyshev_objective)
      # Gets constructed on property access.
      self.assertIsNotNone(mars.chebyshev_objective)
      self.assertIsNotNone(mars._chebyshev_objective)
      # Destored on updating the weights.
      mars.chebyshev_weights = [0.5, 0.3]
      self.assertIsNone(mars._chebyshev_objective)
      # Destroyed on setting baseline_Y.
      mars.chebyshev_objective
      mars.baseline_Y = None
      self.assertIsNone(mars._chebyshev_objective)
  
      # Error if baseline_Y is not set.
      with self.assertRaisesRegex(RuntimeError, "baseline_Y"):
          MARS(
              alpha=0.5,
              n_w=3,
              chebyshev_weights=[0.5, 0.5],
          ).chebyshev_objective
  
      for dtype in (torch.float, torch.double):
          tkwargs = {"dtype": dtype, "device": self.device}
          # Without ref point or pre-processing.
          mars = MARS(
              alpha=0.5,
              n_w=3,
              chebyshev_weights=[0.5, 0.5],
              baseline_Y=torch.tensor(
                  [[0.0, 0.5], [0.5, 0.0]], **tkwargs
              ),
          )
          obj = mars.chebyshev_objective
          Y = torch.ones(2, 2, **tkwargs)
          self.assertAllClose(obj(Y), torch.ones(2, **tkwargs))
          # With pre-processing.
          mars = MARS(
              alpha=0.5,
              n_w=3,
              chebyshev_weights=[0.5, 0.5],
              baseline_Y=torch.tensor(
                  [[0.0, 0.5], [0.5, 0.0]], **tkwargs
              ),
              preprocessing_function=lambda Y: -Y,
          )
          obj = mars.chebyshev_objective
          Y = -torch.ones(2, 2, **tkwargs)
          self.assertAllClose(obj(Y), torch.ones(2, **tkwargs))
          # With ref point.
          mars = MARS(
              alpha=0.5,
              n_w=3,
              chebyshev_weights=[0.5, 0.5],
              baseline_Y=torch.tensor(
                  [[0.0, 0.5], [0.5, 0.0]], **tkwargs
              ),
              ref_point=[1.0, 1.0],
          )
          obj = mars.chebyshev_objective
          Y = torch.ones(2, 2, **tkwargs)
          self.assertAllClose(obj(Y), torch.zeros(2, **tkwargs))
  
imports: import warnings
  from typing import Optional
  import torch
  from botorch import settings
  from botorch.acquisition.multi_objective.multi_output_risk_measures import IndependentCVaR, IndependentVaR, MARS, MultiOutputExpectation, MultiOutputRiskMeasureMCObjective, MultiOutputWorstCase, MVaR
  from botorch.acquisition.multi_objective.objective import IdentityMCMultiOutputObjective, WeightedMCMultiOutputObjective
  from botorch.exceptions.errors import UnsupportedError
  from botorch.exceptions.warnings import BotorchWarning
  from botorch.models.deterministic import GenericDeterministicModel
  from botorch.models.transforms.input import InputPerturbation
  from botorch.utils.multi_objective.pareto import is_non_dominated
  from botorch.utils.testing import BotorchTestCase
  from torch import Tensor
label_desc: Use image node_id 4 for calling the TestMARS obj's underlying member method code with example usage: obj.test_chebyshev_objective() without return types