Skip to content

Commit 1be95bd

Browse files
authored
Merge pull request #151 from fonnesbeck/backend_default_arg
Fix default argument for backend in compile_pymc_model
2 parents d94472d + 29cd996 commit 1be95bd

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

python/nutpie/compile_pymc.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ def compile_pymc_model(
355355
model: "pm.Model",
356356
*,
357357
backend: Literal["numba", "jax"] = "numba",
358-
gradient_backend: Literal["pytensor", "jax"] | None = None,
358+
gradient_backend: Literal["pytensor", "jax"] = "pytensor",
359359
**kwargs,
360360
) -> CompiledModel:
361361
"""Compile necessary functions for sampling a pymc model.
@@ -384,10 +384,9 @@ def compile_pymc_model(
384384
"and restart your kernel in case you are in an interactive session."
385385
)
386386

387-
if backend is None:
388-
backend = "numba"
389-
390387
if backend.lower() == "numba":
388+
if gradient_backend == "jax":
389+
raise ValueError("Gradient backend cannot be jax when using numba backend")
391390
return _compile_pymc_model_numba(model, **kwargs)
392391
elif backend.lower() == "jax":
393392
return _compile_pymc_model_jax(

0 commit comments

Comments
 (0)