Tensor shape checks inspired by einstein notation
Project description
eincheck
Tensor shape checks inspired by einstein notation
Overview
This library has three main functions:
check_shapestakes tuples of(Tensor, shape)and checks that all the Tensors match the shapes
check_shapes((x, "i 3"), (y, "i 3"))
check_funcis a function decorator to check the input and output shapes of a function
@check_func("*i x, *i y -> *i (x + y)")
def concat(a, b):
return np.concatenate([a, b], -1)
check_datais a class decorator to check the fields of a data class
@check_data(start="i 2", end="i 2")
class LineSegment2D(NamedTuple):
start: torch.Tensor
end: torch.Tensor
For more info, read the docs!
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
eincheck-0.6.3.tar.gz
(13.8 kB
view details)
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
eincheck-0.6.3-py3-none-any.whl
(18.3 kB
view details)
File details
Details for the file eincheck-0.6.3.tar.gz.
File metadata
- Download URL: eincheck-0.6.3.tar.gz
- Upload date:
- Size: 13.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.9.6 Darwin/24.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7feb6f418e9a082b206af577988ae82aec58a192358de298a941bb38089a05c
|
|
| MD5 |
4caa8dd1bfc8af58489ee68e26c24698
|
|
| BLAKE2b-256 |
83bc4c8ec0e810e9e92d435fdf09590b386ec75da58d67c89817da1f7fea681e
|
File details
Details for the file eincheck-0.6.3-py3-none-any.whl.
File metadata
- Download URL: eincheck-0.6.3-py3-none-any.whl
- Upload date:
- Size: 18.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.9.6 Darwin/24.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ddbe8c6600c8cec1e695537ef8745afcb9bb7042022765d15306bfb88fe20e6f
|
|
| MD5 |
9926df5b4c30f4be79514a13386b182d
|
|
| BLAKE2b-256 |
351a46433fbb465a92e15c91a417df2ba135e11869018711b8a5be3e25a83fc5
|