pymc.step_methods.BinaryGibbsMetropolis.fork#

BinaryGibbsMetropolis.fork(rng)#

Return an independent copy of this step for a new chain in a thread.

Threaded (free-threaded / no-GIL) multi-chain sampling runs one chain per thread sharing a single model. Each chain needs a step with its own mutable state – compiled-function storage, shared variables, tuning and adaptation state, and RNG – or the chains race. fork produces such an independent copy, ideally sharing read-only compiled code.

The base implementation raises NotImplementedError. A step type opts in to threaded sampling by overriding fork; until then, a threaded sampler must catch this and fall back to multiprocessing. Failing loudly (rather than a generic best-effort copy) keeps unknown or third-party step methods correct-by-default and lets fork be added incrementally.