Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for passing of backend and gradient_backend to nutpie #7535

Merged
merged 2 commits into from
Oct 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
"`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(

Check warning on line 312 in pymc/sampling/mcmc.py

View check run for this annotation

Codecov / codecov/patch

pymc/sampling/mcmc.py#L308-L312

Added lines #L308 - L312 were not covered by tests
model,
**compile_kwargs,
)
t_start = time.time()
idata = nutpie.sample(
compiled_model,
Expand Down
Loading