pixano_inference.frameworks.jax
JAX framework adapter.
Provides framework-neutral device/dtype resolution and numpy interchange for custom models written in JAX. JAX is imported lazily; importing this module does not require it.
JaxAdapter
:class:~pixano_inference.frameworks.base.FrameworkAdapter for JAX.
from_numpy(array, device=None, dtype=None)
Convert a numpy array to a JAX array on device with dtype.
Source code in pixano_inference/frameworks/jax.py
is_available()
resolve_device(num_gpus)
Return a JAX device: a GPU/TPU device when requested and present, else CPU.
Source code in pixano_inference/frameworks/jax.py
resolve_dtype(dtype)
Resolve a jax.numpy dtype from a string (e.g. "float32", "bfloat16").