code: def run_gaussian_estimator(
      estimator: Callable[
          [Tensor], Tuple[Tensor, Union[Tensor, float, int]]
      ],
      sqrt_cov: Tensor,
      num_samples: int,
      batch_limit: Optional[int] = None,
      seed: Optional[int] = None,
  ) -> Tensor:
      if batch_limit is None:
          batch_limit = num_samples
  
      ndim = sqrt_cov.shape[-1]
      tkwargs = {"dtype": sqrt_cov.dtype, "device": sqrt_cov.device}
      counter = 0
      numerator = 0
      denominator = 0
      with torch.random.fork_rng():
          if seed:
              torch.random.manual_seed(seed)
  
          while counter < num_samples:
              batch_size = min(batch_limit, num_samples - counter)
              samples = torch.tensordot(
                  torch.randn(batch_size, ndim, **tkwargs),
                  sqrt_cov,
                  dims=([1], [-1]),
              )
  
              batch_numerator, batch_denominator = estimator(samples)
              counter = counter + batch_size
              numerator = numerator + batch_numerator
              denominator = denominator + batch_denominator
  
      return numerator / denominator, denominator
  
imports: from __future__ import annotations
  from copy import deepcopy
  from functools import partial
  from itertools import count
  from typing import Any, Callable, Dict, Optional, Sequence, Tuple, Union
  from unittest.mock import patch
  import torch
  from botorch.utils.probability.linalg import PivotedCholesky
  from botorch.utils.probability.mvnxpb import MVNXPB
  from botorch.utils.testing import BotorchTestCase
  from linear_operator.utils.errors import NotPSDError
  from torch import Tensor
label_desc: Use image node_id 1 for calling a global function with example usage: run_gaussian_estimator(estimator, sqrt_cov, num_samples, batch_limit, seed) and returns: unknown,  denominator