code: def test_Acq(self) -> None:
      B = torch.tensor(
          [[1.0, 2.0, 3.0, 4.0, 5.0], [2.0, 3.0, 4.0, 5.0, 6.0]],
          dtype=torch.double,
      )
      train_X = torch.tensor(
          [[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]], dtype=torch.double
      )
      train_Y = torch.tensor([[1.0], [2.0], [3.0]], dtype=torch.double)
      train_Yvar = 0.1 * torch.ones(3, 1, dtype=torch.double)
      with self.assertWarnsRegex(
          DeprecationWarning, "ALEBOGP is deprecated"
      ):
          m = ALEBOGP(
              B=B,
              train_X=train_X,
              train_Y=train_Y,
              train_Yvar=train_Yvar,
          )
      m.eval()
  
      objective_weights = torch.tensor([1.0], dtype=torch.double)
      acq = ei_or_nei(
          model=m,
          objective_weights=objective_weights,
          outcome_constraints=None,
          X_observed=train_X,
          X_pending=None,
          q=1,
          noiseless=True,
      )
      self.assertIsInstance(acq, ExpectedImprovement)
      self.assertEqual(acq.best_f.item(), 3.0)
  
      objective_weights = torch.tensor([-1.0], dtype=torch.double)
      acq = ei_or_nei(
          model=m,
          objective_weights=objective_weights,
          outcome_constraints=None,
          X_observed=train_X,
          X_pending=None,
          q=1,
          noiseless=True,
      )
      self.assertEqual(acq.best_f.item(), 1.0)
      with mock.patch(
          "ax.models.torch.alebo.optimize_acqf",
          autospec=True,
          return_value=(train_X, train_Y),
      ) as optim_mock:
          alebo_acqf_optimizer(
              acq_function=acq,
              # pyre-fixme[6]: For 2nd param expected `Tensor` but got `None`.
              bounds=None,
              n=1,
              # pyre-fixme[6]: For 4th param expected `Optional[List[Tuple[Tensor,
              #  Tensor, float]]]` but got `float`.
              inequality_constraints=5.0,
              fixed_features=None,
              rounding_func=None,
              raw_samples=100,
              num_restarts=5,
              B=B,
          )
      self.assertEqual(optim_mock.call_count, 1)
      self.assertIsInstance(
          optim_mock.mock_calls[0][2]["acq_function"],
          ExpectedImprovement,
      )
  
      acq = ei_or_nei(
          model=m,
          objective_weights=objective_weights,
          outcome_constraints=None,
          X_observed=train_X,
          X_pending=None,
          q=1,
          noiseless=False,
      )
      self.assertIsInstance(acq, qLogNoisyExpectedImprovement)
  
      with mock.patch(
          "ax.models.torch.alebo.optimize_acqf",
          autospec=True,
          return_value=(train_X, train_Y),
      ) as optim_mock:
          alebo_acqf_optimizer(
              acq_function=acq,
              # pyre-fixme[6]: For 2nd param expected `Tensor` but got `None`.
              bounds=None,
              n=2,
              # pyre-fixme[6]: For 4th param expected `Optional[List[Tuple[Tensor,
              #  Tensor, float]]]` but got `float`.
              inequality_constraints=5.0,
              fixed_features=None,
              rounding_func=None,
              raw_samples=100,
              num_restarts=5,
              B=B,
          )
  
      self.assertEqual(optim_mock.call_count, 2)
      self.assertIsInstance(
          optim_mock.mock_calls[0][2]["acq_function"],
          qLogNoisyExpectedImprovement,
      )
      self.assertEqual(optim_mock.mock_calls[0][2]["num_restarts"], 5)
      self.assertEqual(
          optim_mock.mock_calls[0][2]["inequality_constraints"], 5.0
      )
      X = optim_mock.mock_calls[0][2]["batch_initial_conditions"]
      self.assertEqual(X.shape, torch.Size([5, 1, 2]))
      # Make sure initialization is inside subspace
      Z = (B @ torch.pinverse(B) @ X[:, 0, :].t()).t()
      self.assertTrue(torch.allclose(Z, X[:, 0, :]))
  
file_path: Ax/ax/models/tests/test_alebo.py
imports: from unittest import mock
  import numpy
  import torch
  from ax.core.search_space import SearchSpaceDigest
  from ax.models.torch.alebo import ALEBO, alebo_acqf_optimizer, ALEBOGP, ALEBOKernel, ei_or_nei, extract_map_statedict, get_batch_model, get_fitted_model, get_map_model
  from ax.models.torch_base import TorchOptConfig
  from ax.utils.common.testutils import TestCase
  from ax.utils.common.typeutils import checked_cast
  from ax.utils.testing.mock import fast_botorch_optimize
  from botorch.acquisition import qLogNoisyExpectedImprovement
  from botorch.acquisition.analytic import ExpectedImprovement
  from botorch.models.model_list_gp_regression import ModelListGP
  from botorch.utils.datasets import SupervisedDataset
  from torch.nn.parameter import Parameter
label_desc: Use image node_id 3 for calling the ALEBOTest obj's underlying member method code with example usage: obj.test_Acq() without return types