Haliax (version 1.3) provides named tensors for JAX, enhancing legibility and reducing common shape-related errors in deep learning models. It builds on JAX's power by allowing users to refer to tensor dimensions by name, simplifying complex operations like broadcasting, reduction, and concatenation. The library is actively developed with frequent minor releases and occasional major updates.
pip install haliaxVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to define named axes, create `NamedArray` instances with these axes, and perform basic operations like reduction and dot products, highlighting how Haliax manages dimension alignment by name.
Consult the Haliax 1.0+ documentation for updated API calls, especially for neural network layers and partitioning utilities. Many functions were integrated into `NamedArray` methods.
Use `NamedArray.array` to access the underlying JAX array when interfacing with JAX functions not aware of Haliax. Convert back using `hx.NamedArray(raw_array, axes)` to restore named dimension benefits.
Debug code without `jax.jit` first. Ensure `Axis` objects are hashable and defined globally or passed consistently, avoiding their creation inside `jit`-ted functions where they might be re-instantiated.
Where possible, replace `AxisSpec` patterns with direct `Axis` objects or explicit tuples of `Axis` instances to define dimensions.