sbi-dev/sbi

MCMCPosterior not pickable after vectorized slice sampling

Opened this issue · 0 comments

Describe the bug
The new support for batched sampling introduced a local function multi_obs_potential. This will be cached as posterior sampler in self making it not saveable using pickle.

Expected behavior
Should be saveable as the rest of the posteriors.

Possible fixes:

  • overwrite get_state and set self.posterior._posterior_sampler = None (remove cached object)
  • not using local functions.