code: def test_independent_cvar(self):
      obj = IndependentCVaR(alpha=0.5, n_w=3)
      self.assertEqual(obj.alpha_idx, 1)
      with self.assertRaises(ValueError):
          IndependentCVaR(alpha=3, n_w=3)
      for dtype in (torch.float, torch.double):
          obj = IndependentCVaR(alpha=0.5, n_w=3)
          samples = torch.tensor(
              [
                  [
                      [1.0, 1.2],
                      [0.5, 0.7],
                      [2.0, 2.2],
                      [3.0, 1.2],
                      [1.0, 7.2],
                      [5.0, 5.8],
                  ]
              ],
              device=self.device,
              dtype=dtype,
          )
          rm_samples = obj(samples)
          self.assertTrue(
              torch.allclose(
                  rm_samples,
                  torch.tensor(
                      [[[0.75, 0.95], [2.0, 3.5]]],
                      device=self.device,
                      dtype=dtype,
                  ),
              )
          )
          # w/ first output negated
          obj.preprocessing_function = WeightedMCMultiOutputObjective(
              torch.tensor([-1.0, 1.0], device=self.device, dtype=dtype)
          )
          rm_samples = obj(samples)
          self.assertTrue(
              torch.allclose(
                  rm_samples,
                  torch.tensor(
                      [[[-1.5, 0.95], [-4.0, 3.5]]],
                      device=self.device,
                      dtype=dtype,
                  ),
              )
          )
  
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 1 for calling the TestIndependentCVaR obj's underlying member method code with example usage: obj.test_independent_cvar() without return types