Discover and explore top open-source AI tools and projects—updated daily.
patrick-kidgerTyping library for array shapes/dtypes
Top 25.9% on SourcePulse
jaxtyping provides type annotations and runtime checking for the shape and dtype of arrays from JAX, PyTorch, NumPy, MLX, and TensorFlow, as well as PyTrees. It enables developers to enforce array dimensions and data types at runtime, improving code robustness and maintainability for machine learning and scientific computing tasks.
How It Works
The library uses a novel annotation system where array types are specified with a base type (e.g., Float, Int) followed by shape and dtype constraints within square brackets (e.g., Float[Array, "batch height width"]). This allows for precise specification of array structures, which can then be validated at runtime by compatible type-checking libraries like typeguard or beartype. This approach offers a declarative way to ensure array integrity without manual checks.
Quick Start & Requirements
pip install jaxtypingtypeguard or beartype for runtime checking.Highlighted Details
Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
The library is primarily focused on static analysis and runtime checking of array shapes and dtypes; it does not perform numerical computations itself. JAX-specific types are unavailable if JAX is not installed.
1 month ago
1 day
fferflo
ofnote
google-deepmind
imaurer
patrick-kidger
explosion
ggml-org
apache