class_docstr: Inference by enumerating executions ordered by their probabilities.
  Exact (and results equivalent to Search) if all executions are enumerated.
code: def _traces(self, *args, **kwargs):
      q = queue.PriorityQueue()
      # add a little bit of noise to the priority to break ties...
      q.put(
          (
              torch.zeros(1).item() - torch.rand(1).item() * 1e-2,
              poutine.Trace(),
          )
      )
      q_fn = pqueue(self.model, queue=q)
      for i in range(self.num_samples):
          if q.empty():
              # num_samples was too large!
              break
          tr = poutine.trace(q_fn).get_trace(
              *args, **kwargs
          )  # XXX should block
          yield tr, tr.log_prob_sum()
  
imports: import collections
  import functools
  import queue
  import torch
  import pyro.distributions
  import pyro.poutine
  from pyro.infer.abstract_infer import TracePosterior
  from pyro.poutine.runtime import NonlocalExit
label_desc: Use image node_id 2 for calling the BestFirstSearch obj's underlying member method code with example usage: obj._traces() without return types