code: def _setUp(self, double=False):
      dtype = torch.double if double else torch.float
      train_x = torch.linspace(
          0, 1, 10, device=self.device, dtype=dtype
      ).view(-1, 1)
      train_y = torch.sin(train_x * (2 * math.pi))
      train_yvar = torch.tensor(
          0.1**2, device=self.device, dtype=dtype
      )
      noise = torch.tensor(NOISE, device=self.device, dtype=dtype)
      self.train_x = train_x
      self.train_y = train_y + noise
      self.train_yvar = train_yvar
      self.bounds = torch.tensor(
          [[0.0], [1.0]], device=self.device, dtype=dtype
      )
      model_st = SingleTaskGP(self.train_x, self.train_y)
      self.model_st = model_st.to(device=self.device, dtype=dtype)
      self.mll_st = ExactMarginalLogLikelihood(
          self.model_st.likelihood, self.model_st
      )
      with warnings.catch_warnings():
          warnings.filterwarnings(
              "ignore", category=OptimizationWarning
          )
          self.mll_st = fit_gpytorch_mll(
              self.mll_st,
              optimizer_kwargs={"options": {"maxiter": 5}},
              max_attempts=1,
          )
      model_fn = SingleTaskGP(
          self.train_x,
          self.train_y,
          self.train_yvar.expand_as(self.train_y),
      )
      self.model_fn = model_fn.to(device=self.device, dtype=dtype)
      self.mll_fn = ExactMarginalLogLikelihood(
          self.model_fn.likelihood, self.model_fn
      )
      with warnings.catch_warnings():
          warnings.filterwarnings(
              "ignore", category=OptimizationWarning
          )
          self.mll_fn = fit_gpytorch_mll(
              self.mll_fn,
              optimizer_kwargs={"options": {"maxiter": 5}},
              max_attempts=1,
          )
  
file_path: botorch/test/test_end_to_end.py
imports: import math
  import warnings
  import torch
  from botorch.acquisition import ExpectedImprovement, qExpectedImprovement
  from botorch.exceptions.warnings import OptimizationWarning
  from botorch.fit import fit_gpytorch_mll
  from botorch.models.gp_regression import SingleTaskGP
  from botorch.optim import optimize_acqf
  from botorch.utils.testing import BotorchTestCase
  from gpytorch.mlls.exact_marginal_log_likelihood import ExactMarginalLogLikelihood
label_desc: Use image node_id 1 for calling the TestEndToEnd obj's underlying member method code with example usage: obj._setUp(double) without return types