Runtime shape contracts and diagnostics for NumPy and JAX
Project description
ShapeGuard
Runtime shape contracts and diagnostics for NumPy and JAX.
Installation
pip install shapeguard
Quick Start
from shapeguard import Dim, expects
n, m, k = Dim("n"), Dim("m"), Dim("k")
@expects(a=(n, m), b=(m, k))
def matmul(a, b):
return a @ b
When shapes don't match, you get clear errors:
ShapeGuardError:
function: matmul
argument: b
expected: (m, k)
actual: (5, 7)
reason: dimension 'm' bound to 4 from a.shape[1], but got 5 from b.shape[0]
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jax_shapeguard-0.3.0.tar.gz.
File metadata
- Download URL: jax_shapeguard-0.3.0.tar.gz
- Upload date:
- Size: 27.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a680ca94df6b8c5f3376433072488e06983bb14430ff9ba5f50dd8c1ece09fa
|
|
| MD5 |
6f8e96dee26d38a613ca7456b97c276a
|
|
| BLAKE2b-256 |
e3f08a97077ce69d47e0c15e309bc7df528f321759a40a274aa1c0ad0906f9c0
|
Provenance
The following attestation bundles were made for jax_shapeguard-0.3.0.tar.gz:
Publisher:
publish.yml on jayendra13/jax-shape-guard
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jax_shapeguard-0.3.0.tar.gz -
Subject digest:
5a680ca94df6b8c5f3376433072488e06983bb14430ff9ba5f50dd8c1ece09fa - Sigstore transparency entry: 928409307
- Sigstore integration time:
-
Permalink:
jayendra13/jax-shape-guard@d0f65c6bb64496cfff51cd39329364d4470c4cc5 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/jayendra13
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d0f65c6bb64496cfff51cd39329364d4470c4cc5 -
Trigger Event:
release
-
Statement type:
File details
Details for the file jax_shapeguard-0.3.0-py3-none-any.whl.
File metadata
- Download URL: jax_shapeguard-0.3.0-py3-none-any.whl
- Upload date:
- Size: 17.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c95e3d08439f16a6d17186938593f5c238006898ad783fe8f2dfc5baabe31a4c
|
|
| MD5 |
bb5659267af5b45ce0fd60cb7c136e9d
|
|
| BLAKE2b-256 |
131f19e31f5d7db8cddd9fe1a2da1b9fbf76858339282d4d88d10c3a6254545e
|
Provenance
The following attestation bundles were made for jax_shapeguard-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on jayendra13/jax-shape-guard
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jax_shapeguard-0.3.0-py3-none-any.whl -
Subject digest:
c95e3d08439f16a6d17186938593f5c238006898ad783fe8f2dfc5baabe31a4c - Sigstore transparency entry: 928409308
- Sigstore integration time:
-
Permalink:
jayendra13/jax-shape-guard@d0f65c6bb64496cfff51cd39329364d4470c4cc5 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/jayendra13
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d0f65c6bb64496cfff51cd39329364d4470c4cc5 -
Trigger Event:
release
-
Statement type: