code: def _compute_tmc_estimate(model_trace, guide_trace):
      """
      Use :func:`~pyro.ops.contract.einsum` to compute the Tensor Monte Carlo
      estimate of the marginal likelihood given parallel-sampled traces.
      """
      # factors
      log_factors = _compute_tmc_factors(model_trace, guide_trace)
      log_factors += _compute_dice_factors(model_trace, guide_trace)
  
      if not log_factors:
          return 0.0
  
      # loss
      eqn = ",".join([f._pyro_dims for f in log_factors]) + "->"
      plates = "".join(
          frozenset().union(
              list(model_trace.plate_to_symbol.values()),
              list(guide_trace.plate_to_symbol.values()),
          )
      )
      (tmc,) = einsum(
          eqn,
          *log_factors,
          plates=plates,
          backend="pyro.ops.einsum.torch_log",
          modulo_total=False,
      )
      return tmc
  
imports: import queue
  import warnings
  import torch
  import pyro.poutine
  from pyro.distributions.util import is_identically_zero
  from pyro.infer.elbo import ELBO
  from pyro.infer.enum import get_importance_trace, iter_discrete_escape, iter_discrete_extend
  from pyro.infer.util import compute_site_dice_factor, is_validation_enabled, torch_item
  from pyro.ops import packed
  from pyro.ops.contract import einsum
  from pyro.poutine.enum_messenger import EnumMessenger
  from pyro.util import check_traceenum_requirements, warn_if_nan
label_desc: Use image node_id 3 for calling a global function with example usage: _compute_tmc_estimate(model_trace, guide_trace) and returns: tmc, int