code: def _base_test_with_learned_objective(
      self,
      train_batch_shape: torch.Size,
      prune_baseline: bool,
      test_batch_shape: torch.Size,
  ) -> None:
      acq_inputs = self._get_acqf_inputs(
          train_batch_shape=train_batch_shape, m=4
      )
  
      pref_sample_shapes = [1, 8]
      test_acqf_classes_and_kws = [
          (qExpectedImprovement, {}),
          (qProbabilityOfImprovement, {}),
          (qLogExpectedImprovement, {}),
          (
              qNoisyExpectedImprovement,
              {"prune_baseline": prune_baseline},
          ),
          (
              qLogNoisyExpectedImprovement,
              {"prune_baseline": prune_baseline},
          ),
      ]
  
      for (acqf_cls, kws), pref_sample_shape in product(
          test_acqf_classes_and_kws, pref_sample_shapes
      ):
          with self.subTest(
              train_batch_shape=train_batch_shape,
              test_batch_shape=test_batch_shape,
              prune_baseline=prune_baseline,
              acqf_cls=acqf_cls,
              pref_sample_shape=pref_sample_shape,
          ):
              objective = LearnedObjective(
                  pref_model=acq_inputs["pref_model"],
                  sample_shape=torch.Size([pref_sample_shape]),
              )
              test_x = torch.rand(
                  (
                      *test_batch_shape,
                      *train_batch_shape,
                      self.q,
                      self.d,
                  ),
                  **self.tkwargs,
              )
              input_constructor = get_acqf_input_constructor(
                  acqf_cls=acqf_cls
              )
  
              inputs = input_constructor(
                  objective=objective,
                  model=acq_inputs["model"],
                  training_data=acq_inputs["training_data"],
                  X_baseline=acq_inputs["train_x"],
                  sampler=SobolQMCNormalSampler(torch.Size([4])),
                  **kws,
              )
              acqf = acqf_cls(**inputs)
              acq_val = acqf(test_x)
              self.assertEqual(
                  acq_val.shape.numel(), test_x.shape[:-2].numel()
              )
  
imports: from itertools import product
  from typing import Dict
  from warnings import catch_warnings, simplefilter
  import torch
  from botorch.acquisition.input_constructors import get_acqf_input_constructor
  from botorch.acquisition.logei import qLogExpectedImprovement, qLogNoisyExpectedImprovement
  from botorch.acquisition.monte_carlo import qExpectedImprovement, qNoisyExpectedImprovement, qProbabilityOfImprovement
  from botorch.acquisition.objective import LearnedObjective
  from botorch.exceptions.warnings import InputDataWarning
  from botorch.fit import fit_gpytorch_mll
  from botorch.models import SingleTaskGP
  from botorch.sampling.normal import SobolQMCNormalSampler
  from botorch.utils.datasets import SupervisedDataset
  from botorch.utils.testing import BotorchTestCase
  from gpytorch.mlls.exact_marginal_log_likelihood import ExactMarginalLogLikelihood
label_desc: Use image node_id 3 for calling the TestObjectiveAndConstraintIntegration obj's underlying member method code with example usage: obj._base_test_with_learned_objective(train_batch_shape, prune_baseline, test_batch_shape) without return types