Skip to content

Commit

Permalink
Default to using McBackend
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelosthege authored and twiecki committed Mar 1, 2023
1 parent 5510d3f commit 1988b65
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pymc/backends/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@

HAS_MCB = False
try:
from mcbackend import Backend, Run
from mcbackend import Backend, NumPyBackend, Run

from pymc.backends.mcbackend import init_chain_adapters

Expand Down Expand Up @@ -123,6 +123,8 @@ def init_traces(
model: Model,
) -> Tuple[Optional[RunType], Sequence[IBaseTrace]]:
"""Initializes a trace recorder for each chain."""
if HAS_MCB and backend is None:
backend = NumPyBackend(preallocate=expected_length)
if HAS_MCB and isinstance(backend, Backend):
return init_chain_adapters(
backend=backend,
Expand Down

0 comments on commit 1988b65

Please sign in to comment.