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.0.tar.gz
(52.5 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.0-py3-none-any.whl
(19.7 kB
view details)
File details
Details for the file eincheck-0.6.0.tar.gz.
File metadata
- Download URL: eincheck-0.6.0.tar.gz
- Upload date:
- Size: 52.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.7.4 Darwin/23.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
147064cdbc8df041b327360e40870871d93c4305971685a66ff88796f12f99d0
|
|
| MD5 |
54dc5662c60a65a5b3f63bd1d95010cb
|
|
| BLAKE2b-256 |
c90f24b5ab6b751cdab5a7d0065e69971e95cab90af8624cf753f269c3ba4df0
|
File details
Details for the file eincheck-0.6.0-py3-none-any.whl.
File metadata
- Download URL: eincheck-0.6.0-py3-none-any.whl
- Upload date:
- Size: 19.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.7.4 Darwin/23.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
495f71fb9380d8160e54a96ca98e6fbe0a672d51a2fbc7a09a60f5446cdda84a
|
|
| MD5 |
d98a1466d71cc4b5202b9fa34e375d6e
|
|
| BLAKE2b-256 |
5305b0e7b792f486acf34e4b5dce6fcf10f3829ea41671cf77c96221a6189a9c
|