code: def setUp(self) -> None:
      super().setUp()
      tkwargs = {"device": self.device, "dtype": torch.float64}
      torch.manual_seed(0)
  
      base = MaternKernel(nu=2.5, ard_num_dims=2, batch_shape=Size([]))
      base.lengthscale = 0.1 + 0.3 * torch.rand_like(base.lengthscale)
      kernel = ScaleKernel(base)
      kernel.to(**tkwargs)
  
      uppers = 1 + 9 * torch.rand(base.lengthscale.shape[-1], **tkwargs)
      bounds = pad(uppers.unsqueeze(0), (0, 0, 1, 0))
      X = uppers * torch.rand(4, base.lengthscale.shape[-1], **tkwargs)
      Y = 10 * kernel(X).cholesky() @ torch.randn(4, 1, **tkwargs)
      input_transform = Normalize(d=X.shape[-1], bounds=bounds)
      outcome_transform = Standardize(m=Y.shape[-1])
  
      # SingleTaskGP w/ inferred noise in eval mode
      self.inferred_noise_gp = SingleTaskGP(
          train_X=X,
          train_Y=Y,
          covar_module=deepcopy(kernel),
          input_transform=deepcopy(input_transform),
          outcome_transform=deepcopy(outcome_transform),
      ).eval()
  
      # SingleTaskGP with observed noise in train mode
      self.observed_noise_gp = SingleTaskGP(
          train_X=X,
          train_Y=Y,
          train_Yvar=0.01 * torch.rand_like(Y),
          covar_module=kernel,
          input_transform=input_transform,
          outcome_transform=outcome_transform,
      )
  
      # SingleTaskVariationalGP in train mode
      self.variational_gp = SingleTaskVariationalGP(
          train_X=X,
          train_Y=Y,
          covar_module=kernel,
          input_transform=input_transform,
          outcome_transform=outcome_transform,
      ).to(**tkwargs)
  
file_path: botorch/test/sampling/pathwise/test_posterior_samplers.py
imports: from __future__ import annotations
  from copy import deepcopy
  import torch
  from botorch.models import ModelListGP, SingleTaskGP, SingleTaskVariationalGP
  from botorch.models.transforms.input import Normalize
  from botorch.models.transforms.outcome import Standardize
  from botorch.sampling.pathwise import draw_matheron_paths, MatheronPath, PathList
  from botorch.sampling.pathwise.utils import get_train_inputs
  from botorch.utils.test_helpers import get_sample_moments, standardize_moments
  from botorch.utils.testing import BotorchTestCase
  from gpytorch.kernels import MaternKernel, ScaleKernel
  from torch import Size
  from torch.nn.functional import pad
label_desc: Use image node_id 1 for calling the TestPosteriorSamplers obj's underlying member method code with example usage: obj.setUp() without return types