aeppl.utils.walk_model#

aeppl.utils.walk_model(graphs, walk_past_rvs=False, stop_at_vars=None, expand_fn=<function <lambda>>)[source]#

Walk model graphs and yield their nodes.

By default, these walks will not go past MeasurableVariable nodes.

Parameters
  • graphs (Iterable[TensorVariable]) – The graphs to walk.

  • walk_past_rvs (bool) – If True, the walk will not terminate at ``MeasurableVariable``s.

  • stop_at_vars (Optional[Set[TensorVariable]]) – A list of variables at which the walk will terminate.

  • expand_fn (Callable[[TensorVariable], List[TensorVariable]]) – A function that returns the next variable(s) to be traversed.

Return type

Generator[TensorVariable, None, None]