Home
Elegant shape and dtype validation for NumPy, JAX, PyTorch, and CuPy arrays
Powered by
beartype
Zero Boilerplate¶
Works with standard @beartype decorators and beartype.claw import hooks. No custom decorator required.
Cross-Argument Consistency¶
Named dimensions are enforced across all parameters and the return value within a single function call.
Static Type Checker Friendly¶
Core annotations type-check on pyright, mypy, and ty, with documented tricks for runtime-only syntax such as fixed literal dims and symbolic shapes.
Readable Annotations¶
F32[N, C, H, W] reads like documentation. No string parsing, no magic syntax.
Full BeartypeConf Support¶
Unlike jaxtyping, shapix doesn't replace your beartype configuration. Full BeartypeConf support out of the box.
Thread-Safe & Async-Safe¶
Automatic memo discovery is thread-safe, and the explicit memo stack used by @shapix.check and check_context() is async-safe too.