code: def test_MultivariateNormalQMCEngineShapiroInvTransform(self):
      for dtype in (torch.float, torch.double):
          # test the standard case
          mean = torch.zeros(2, device=self.device, dtype=dtype)
          cov = torch.eye(2, device=self.device, dtype=dtype)
          engine = MultivariateNormalQMCEngine(
              mean=mean, cov=cov, seed=12345, inv_transform=True
          )
          samples = engine.draw(n=256)
          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.all(torch.abs(samples.std(dim=0) - 1) < 1e-2)
          )
          # perform Shapiro-Wilk test for normality
          samples = samples.cpu().numpy()
          for i in (0, 1):
              _, pval = shapiro(samples[:, i])
              self.assertGreater(pval, 0.9)
          # make sure samples are uncorrelated
          cov = np.cov(samples.transpose())
          self.assertLess(np.abs(cov[0, 1]), 1e-2)
  
          # test the correlated, non-zero mean case
          mean = torch.tensor(
              [1.0, 2.0], device=self.device, dtype=dtype
          )
          cov = torch.tensor(
              [[1.5, 0.5], [0.5, 1.5]], device=self.device, dtype=dtype
          )
          engine = MultivariateNormalQMCEngine(
              mean=mean, cov=cov, seed=12345, inv_transform=True
          )
          samples = engine.draw(n=256)
          self.assertEqual(samples.dtype, dtype)
          self.assertEqual(samples.device.type, self.device.type)
          self.assertTrue(
              torch.all(torch.abs(samples.mean(dim=0) - mean) < 1e-2)
          )
          self.assertTrue(
              torch.all(
                  torch.abs(samples.std(dim=0) - math.sqrt(1.5)) < 1e-2
              )
          )
          # perform Shapiro-Wilk test for normality
          samples = samples.cpu().numpy()
          for i in (0, 1):
              _, pval = shapiro(samples[:, i])
              self.assertGreater(pval, 0.9)
          # check covariance
          cov = np.cov(samples.transpose())
          self.assertLess(np.abs(cov[0, 1] - 0.5), 1e-2)
  
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 11 for calling the MultivariateNormalQMCTests obj's underlying member method code with example usage: obj.test_MultivariateNormalQMCEngineShapiroInvTransform() without return types