docstr: Monte Carlo unit test for `bvn`.
docstr_tok: ["Monte","Carlo","unit","test","for","`","bvn","`","."]
code: def test_bvnmom(self):
      r"""Monte Carlo unit test for `bvn`."""
      r = self.correlations.repeat(self.nprobs_per_coeff, 1)
      Ex, Ey = bvnmom(r, self.xl, self.yl, self.xu, self.yu)
      with self.assertRaisesRegex(UnsupportedError, "same shape"):
          bvnmom(r[..., :1], self.xl, self.yl, self.xu, self.yu)
  
      def _estimator(samples):
          accept = torch.logical_and(
              (samples > self.lower_bounds.unsqueeze(1)).all(-1),
              (samples < self.upper_bounds.unsqueeze(1)).all(-1),
          )
          numerator = torch.einsum(
              "snd,psn->pnd", samples, accept.to(samples.dtype)
          )
          denominator = torch.count_nonzero(accept, dim=1).to(
              samples.dtype
          )
          return numerator, denominator.unsqueeze(-1)
  
      estimates, num_samples = run_gaussian_estimator(
          estimator=_estimator,
          sqrt_cov=self.sqrt_covariances,
          num_samples=self.mc_num_samples,
          batch_limit=self.mc_batch_limit,
          seed=next(self.seed_generator),
      )
      for n, ex, ey, _ex, _ey in zip(
          *map(
              torch.ravel,
              (num_samples.squeeze(-1), Ex, Ey, *estimates.unbind(-1)),
          )
      ):
          if n:
              atol = self.mc_atol_multiplier * (n**-0.5)
              self.assertAllClose(ex, _ex, rtol=0, atol=atol)
              self.assertAllClose(ey, _ey, rtol=0, atol=atol)
  
imports: from __future__ import annotations
  from itertools import count
  from typing import Any, Callable, Dict, Optional, Tuple, Union
  import torch
  from botorch.exceptions import UnsupportedError
  from botorch.utils.probability.bvn import _bvnu_polar, _bvnu_taylor, bvn, bvnmom, bvnu, Phi
  from botorch.utils.testing import BotorchTestCase
  from torch import Tensor
label_desc: Use image node_id 10 for calling the TestBVN obj's underlying member method code with example usage: obj.test_bvnmom() and returns: numerator,  denominator