pymc.model.transform.optimization.freeze_dims_and_data#

pymc.model.transform.optimization.freeze_dims_and_data(model)[source]#

Recreate a Model with fixed RV dimensions and Data values.

The dimensions of the pre-existing RVs will no longer follow changes to the coordinates. Likewise, it will not be possible to update pre-existing Data in the new model.

Note that any new RVs and Data created after calling this function will still be “unfrozen”.

This transformation may allow more performant sampling, or compiling model functions to backends that are more restrictive about dynamic shapes such as JAX.