Skip to content
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
12 changes: 6 additions & 6 deletions pathwaysutils/jax/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,29 +62,29 @@ def register_backend_cache(cache: Any, name: str, util=util): # pylint: disable
del util

try:
# jax>0.7.0
# jax>=0.7.1
from jax.extend import backend # pylint: disable=g-import-not-at-top

ifrt_proxy = backend.ifrt_proxy
del backend
except AttributeError:
# jax<=0.7.0
# jax<0.7.1
from jax.lib import xla_extension # pylint: disable=g-import-not-at-top

ifrt_proxy = xla_extension.ifrt_proxy
del xla_extension


try:
# jax>=0.7.2
# jax>=0.8.0
from jax.jaxlib import _pathways # pylint: disable=g-import-not-at-top

jaxlib_pathways = _pathways
del _pathways
except (ModuleNotFoundError, AttributeError):
# jax<0.7.2
except ModuleNotFoundError:
# jax<0.8.0

jaxlib_pathways = _FakeJaxModule("jax.jaxlib._pathways", "0.7.2")
jaxlib_pathways = _FakeJaxModule("jax.jaxlib._pathways", "0.8.0")


del _FakeJaxModule