class_docstr: A container for sums of Tensors among different :class:`plate` contexts.
  
  Used in :class:`~pyro.infer.tracegraph_elbo.TraceGraph_ELBO` to simplify
  downstream cost computation logic.
  
  Example::
  
      downstream_cost = MultiFrameTensor()
      for site in downstream_nodes:
          downstream_cost.add((site["cond_indep_stack"], site["log_prob"]))
      downstream_cost.add(*other_costs.items())  # add in bulk
      summed = downstream_cost.sum_to(target_site["cond_indep_stack"])
code: def sum_to(self, target_frames):
      total = None
      for frames, value in self.items():
          for f in frames:
              if f not in target_frames and value.shape[f.dim] != 1:
                  value = value.sum(f.dim, True)
          while value.shape and value.shape[0] == 1:
              value = value.squeeze(0)
          total = value if total is None else total + value
      return 0.0 if total is None else total
  
imports: import math
  import numbers
  from collections import Counter, defaultdict
  from contextlib import contextmanager
  import torch
  from opt_einsum import shared_intermediates
  from opt_einsum.sharing import count_cached_ops
  from pyro.distributions.util import is_identically_zero
  from pyro.ops import packed
  from pyro.ops.einsum.adjoint import require_backward
  from pyro.ops.rings import MarginalRing
  from pyro.poutine.util import site_is_subsample
  from ..None import settings
label_desc: Use image node_id 3 for calling the MultiFrameTensor obj's underlying member method code with example usage: obj.sum_to(target_frames) and returns: unknown