code: def test_forward(self):
      for dtype in (torch.float, torch.double):
          sampler = PairwiseSobolQMCNormalSampler(
              sample_shape=torch.Size([4]), seed=1234
          )
          self.assertEqual(sampler.seed, 1234)
          # check samples non-batched
          posterior = _get_test_posterior(
              device=self.device, dtype=dtype
          )
          samples = sampler(posterior)
          self.assertEqual(samples.shape, torch.Size([4, 3, 2]))
          # ensure samples are the same
          samples2 = sampler(posterior)
          self.assertAllClose(samples, samples2)
          # ensure this works with a differently shaped posterior
          posterior_batched = _get_test_posterior(
              device=self.device, dtype=dtype, batched=True
          )
          samples_batched = sampler(posterior_batched)
          self.assertEqual(
              samples_batched.shape, torch.Size([4, 3, 3, 2])
          )
          # ensure this works when changing the dtype
          new_dtype = (
              torch.float if dtype == torch.double else torch.double
          )
          posterior_batched = _get_test_posterior(
              device=self.device, dtype=new_dtype, batched=True
          )
          samples_batched = sampler(posterior_batched)
          self.assertEqual(
              samples_batched.shape, torch.Size([4, 3, 3, 2])
          )
          # ensure error is rasied when number of points are < 2
          posterior = _get_test_posterior(
              device=self.device, n=1, dtype=dtype
          )
          with self.assertRaises(RuntimeError):
              sampler(posterior)
  
          # check max_num_comparisons
          sampler = PairwiseSobolQMCNormalSampler(
              sample_shape=torch.Size([4]), max_num_comparisons=2
          )
          # check samples non-batched
          posterior = _get_test_posterior(
              device=self.device, dtype=dtype
          )
          samples = sampler(posterior)
          self.assertEqual(samples.shape, torch.Size([4, 2, 2]))
  
file_path: botorch/test/sampling/test_pairwise_sampler.py
imports: import torch
  from botorch.posteriors import GPyTorchPosterior
  from botorch.sampling.pairwise_samplers import PairwiseIIDNormalSampler, PairwiseSobolQMCNormalSampler
  from botorch.utils.testing import BotorchTestCase
  from gpytorch.distributions import MultivariateNormal
label_desc: Use image node_id 1 for calling the TestPairwiseSobolQMCNormalSampler obj's underlying member method code with example usage: obj.test_forward() without return types