pymc.model.fgraph.fgraph_from_model#

pymc.model.fgraph.fgraph_from_model(model, inlined_views=False)[source]#

Convert Model to FunctionGraph.

See: model_from_fgraph

Parameters:
model: PyMC model
inlined_views: bool, default False

Whether “view” variables (Deterministics and Data) should be inlined among RVs in the fgraph, or show up as separate branches.

Returns:
fgraph: FunctionGraph

FunctionGraph that includes a copy of model variables, wrapped in dummy ModelVar Ops. It should be possible to reconstruct a valid PyMC model using model_from_fgraph.

memo: Dict

A dictionary mapping original model variables to the equivalent nodes in the fgraph.