Skip to content

Commit

Permalink
fix: deep copy nuts_sampler_kwarg to prevent .pop side effects (#7652)
Browse files Browse the repository at this point in the history
  • Loading branch information
inclinedadarsh authored Jan 26, 2025
1 parent fa43eba commit 472da97
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pymc/sampling/mcmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ def _sample_external_nuts(
UserWarning,
)
compile_kwargs = {}
nuts_sampler_kwargs = nuts_sampler_kwargs.copy()
for kwarg in ("backend", "gradient_backend"):
if kwarg in nuts_sampler_kwargs:
compile_kwargs[kwarg] = nuts_sampler_kwargs.pop(kwarg)
Expand Down

0 comments on commit 472da97

Please sign in to comment.