code: def test_MultivariateNormalQMCEngineDegenerate(self):
      for dtype in (torch.float, torch.double):
          # X, Y iid standard Normal and Z = X + Y, random vector (X, Y, Z)
          mean = torch.zeros(3, device=self.device, dtype=dtype)
          cov = torch.tensor(
              [[1, 0, 1], [0, 1, 1], [1, 1, 2]],
              device=self.device,
              dtype=dtype,
          )
          engine = MultivariateNormalQMCEngine(
              mean=mean, cov=cov, seed=12345
          )
          samples = engine.draw(n=4096)
          self.assertEqual(samples.dtype, dtype)
          self.assertEqual(samples.device.type, self.device.type)
          self.assertTrue(
              torch.all(torch.abs(samples.mean(dim=0)) < 1e-2)
          )
          self.assertTrue(
              torch.abs(torch.std(samples[:, 0]) - 1) < 1e-2
          )
          self.assertTrue(
              torch.abs(torch.std(samples[:, 1]) - 1) < 1e-2
          )
          self.assertTrue(
              torch.abs(torch.std(samples[:, 2]) - math.sqrt(2)) < 1e-2
          )
          for i in (0, 1, 2):
              _, pval = shapiro(samples[:, i].cpu().numpy())
              self.assertGreater(pval, 0.9)
          cov = np.cov(samples.cpu().numpy().transpose())
          self.assertLess(np.abs(cov[0, 1]), 1e-2)
          self.assertLess(np.abs(cov[0, 2] - 1), 1e-2)
          # check to see if X + Y = Z almost exactly
          self.assertTrue(
              torch.all(
                  torch.abs(
                      samples[:, 0] + samples[:, 1] - samples[:, 2]
                  )
                  < 1e-5
              )
          )
  
imports: import itertools
  import math
  import numpy
  import torch
  from botorch.sampling.qmc import MultivariateNormalQMCEngine, NormalQMCEngine
  from botorch.utils.testing import BotorchTestCase
  from scipy.stats import shapiro
label_desc: Use image node_id 12 for calling the MultivariateNormalQMCTests obj's underlying member method code with example usage: obj.test_MultivariateNormalQMCEngineDegenerate() without return types