Skip to content

Commit 4946523

Browse files
sdaultonmeta-codesync[bot]
authored andcommitted
Handle JAX circular import AttributeError in fully_bayesian.py (#3297)
Summary: Pull Request resolved: #3297 JAX 0.5.3 has a circular import between `pxla.py` and `dispatch.py` that raises `AttributeError` instead of `ImportError` on Python 3.12. The existing `try/except ImportError` guard around JAX imports in `fully_bayesian.py` does not catch this. Reviewed By: Balandat Differential Revision: D102690643 fbshipit-source-id: 6f6a8f69544f4295de31f8c046ffd3e394817e5e
1 parent bcd9016 commit 4946523

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

botorch/models/fully_bayesian.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
import numpyro.distributions as numpyro_dist
4848

4949
_HAS_JAX = True
50-
except ImportError: # pragma: no cover
50+
except (ImportError, AttributeError): # pragma: no cover
5151
_HAS_JAX = False
5252
import torch
5353
from botorch.acquisition.objective import PosteriorTransform

0 commit comments

Comments
 (0)