class_docstr: `Reducer` that accumulates trace results at each sample.
  
  Trace results are defined by an appropriate `trace_fn`, which accepts the
  current chain state and kernel results, and returns the desired result.
  At each sample, the traced values are added to a `TensorArray` which
  accumulates all results. By default, all kernel results are traced but in the
  future the default will be changed to no results being traced, so plan
  accordingly.
  
  If wrapped in a `tfp.experimental.mcmc.WithReductions` Transition Kernel,
  TracingReducer will not accumulate the kernel results of `WithReductions`.
  Rather, the top level kernel results will be that of `WithReductions`' inner
  kernel.
  
  As with all reducers, `TracingReducer` does not hold state information;
  rather, it stores supplied metadata. Intermediate calculations are held in
  a `TracingState` named tuple, which is returned via `initialize` and
  `one_step` method calls.
class_docstr_tok: ["`","Reducer","`","that","accumulates","trace","results","at","each","sample",".","Trace","results","are","defined","by","an","appropriate","`","trace_fn","`",",","which","accepts","the","current","chain","state","and","kernel","results",",","and","returns","the","desired","result",".","At","each","sample",",","the","traced","values","are","added","to","a","`","TensorArray","`","which","accumulates","all","results",".","By","default",",","all","kernel","results","are","traced","but","in","the","future","the","default","will","be","changed","to","no","results","being","traced",",","so","plan","accordingly",".","If","wrapped","in","a","`","tfp.experimental.mcmc.WithReductions","`","Transition","Kernel",",","TracingReducer","will","not","accumulate","the","kernel","results","of","`","WithReductions","`",".","Rather",",","the","top","level","kernel","results","will","be","that","of","`","WithReductions","`","'","inner","kernel",".","As","with","all","reducers",",","`","TracingReducer","`","does","not","hold","state","information",";","rather",",","it","stores","supplied","metadata",".","Intermediate","calculations","are","held","in","a","`","TracingState","`","named","tuple",",","which","is","returned","via","`","initialize","`","and","`","one_step","`","method","calls","."]
code: def trace_fn(self):
      return self._parameters["trace_fn"]
  
file_path: probability/tensorflow_probability/python/experimental/mcmc/tracing_reducer.py
imports: import collections
  import tensorflow.compat.v2
  from tensorflow_probability.python.experimental.mcmc import reducer
  from tensorflow_probability.python.internal import loop_util
  from tensorflow_probability.python.mcmc.internal import util
label_desc: Use image node_id 6 for calling the TracingReducer obj's underlying member method code with example usage: obj.trace_fn() and returns: self