Description
This error came up in pymc-devs/pymc-extras#542. It is caused by PointFunc recursively trying to access self.f during unpickling. MWE:
import pymc as pm
with pm.Model() as m:
x = pm.Categorical('x', logit_p=[1., 1., 1., 1.]))
idata = pm.sample(step=pm.CategoricalGibbsMetropolis([x]), mp_ctx='spawn')
A simple fix would add a check that f has been set inside PointFunc.__getattr__