code: def test_pairwise_mc_post_var(self):
      train_X = torch.tensor(
          [[0.0, 0.0, 0.0], [1.0, 1.0, 0.0]], dtype=torch.double
      )
      train_comp = torch.tensor([[0, 1]], dtype=torch.long)
      model = PairwiseGP(train_X, train_comp)
  
      # example link function
      probit = torch.distributions.normal.Normal(0, 1).cdf
      probit_obj = GenericMCObjective(
          objective=lambda Y, X: probit(Y.squeeze(-1))
      )
      pv = PairwiseMCPosteriorVariance(
          model=model, objective=probit_obj
      )
  
      n_test_pair = 8
      good_X_2 = torch.rand((n_test_pair, 2, 3))
      good_X_4 = torch.rand((n_test_pair, 4, 3))
      bad_X = torch.rand((n_test_pair, 3, 3))
  
      # ensure q is a multiple of 2
      with self.assertRaises(RuntimeError):
          pv(bad_X)
  
      self.assertEqual(pv(good_X_2).shape, torch.Size([n_test_pair]))
      self.assertEqual(pv(good_X_4).shape, torch.Size([n_test_pair]))
  
file_path: botorch/test/acquisition/test_active_learning.py
imports: from unittest import mock
  import torch
  from botorch.acquisition.active_learning import PairwiseMCPosteriorVariance, qNegIntegratedPosteriorVariance
  from botorch.acquisition.objective import GenericMCObjective, ScalarizedPosteriorTransform
  from botorch.models.pairwise_gp import PairwiseGP
  from botorch.posteriors.gpytorch import GPyTorchPosterior
  from botorch.sampling.normal import IIDNormalSampler, SobolQMCNormalSampler
  from botorch.utils.testing import BotorchTestCase, MockModel, MockPosterior
  from gpytorch.distributions import MultitaskMultivariateNormal
label_desc: Use image node_id 1 for calling the TestPairwiseMCPosteriorVariance obj's underlying member method code with example usage: obj.test_pairwise_mc_post_var() without return types