Skip to content

Commit

Permalink
Allow for passing of backend and gradient_backend to nutpie (pymc-dev…
Browse files Browse the repository at this point in the history
…s#7535)

* Allow for passing of backend and gradient_backend to nutpie

* Extract nutpie compiler args explicitly
  • Loading branch information
fonnesbeck authored and mkusnetsov committed Oct 26, 2024
1 parent 6c13e08 commit 31f276f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pymc/sampling/mcmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,14 @@ def _sample_external_nuts(
"`var_names` are currently ignored by the nutpie sampler",
UserWarning,
)
compiled_model = nutpie.compile_pymc_model(model)
compile_kwargs = {}
for kwarg in ("backend", "gradient_backend"):
if kwarg in nuts_sampler_kwargs:
compile_kwargs[kwarg] = nuts_sampler_kwargs.pop(kwarg)
compiled_model = nutpie.compile_pymc_model(
model,
**compile_kwargs,
)
t_start = time.time()
idata = nutpie.sample(
compiled_model,
Expand Down

0 comments on commit 31f276f

Please sign in to comment.