class_docstr: Abstract TracePosterior object from which posterior inference algorithms inherit.
  When run, collects a bag of execution traces from the approximate posterior.
  This is designed to be used by other utility classes like `EmpiricalMarginal`,
  that need access to the collected execution traces.
docstr: Abstract method implemented by classes that inherit from `TracePosterior`.
  
  :return: Generator over ``(exec_trace, weight)`` or
  ``(exec_trace, weight, chain_id)``.
docstr_tok: ["Abstract","method","implemented","by","classes","that","inherit","from","`","TracePosterior","`",".",":","return",":","Generator","over","``","(","exec_trace",",","weight",")","``","or","``","(","exec_trace",",","weight",",","chain_id",")","``","."]
code: def _traces(self, *args, **kwargs):
      """
      Abstract method implemented by classes that inherit from `TracePosterior`.
  
      :return: Generator over ``(exec_trace, weight)`` or
      ``(exec_trace, weight, chain_id)``.
      """
      raise NotImplementedError(
          "Inference algorithm must implement ``_traces``."
      )
  
imports: import numbers
  import warnings
  from abc import ABCMeta, abstractmethod
  from collections import OrderedDict, defaultdict
  import torch
  import pyro.poutine
  from pyro.distributions import Categorical, Empirical
  from pyro.ops.stats import waic
  from pyro.poutine.util import site_is_subsample
label_desc: Use image node_id 4 for calling the TracePosterior obj's underlying member method code with example usage: obj._traces() without return types