Skip to content

Commit

Permalink
Default to using McBackend
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelosthege committed Feb 11, 2023
1 parent 6f723b9 commit 68862bd
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 @@ -73,7 +73,7 @@

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

from pymc.backends.mcbackend import init_chain_adapters

Expand Down Expand Up @@ -119,6 +119,8 @@ def init_traces(
model: Model,
) -> 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 68862bd

Please sign in to comment.