Metadata-Version: 2.1
Name: check-shapes
Version: 0.2.0
Summary: A library for annotating and checking the shapes of tensors.
Home-page: https://gpflow.github.io/check_shapes
License: Apache-2.0
Author: Jesper Nielsen
Author-email: jespernielsen1982+check_shapes@gmail.com
Requires-Python: >=3.7,<3.11
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Debuggers
Classifier: Typing :: Typed
Requires-Dist: lark (>=1.1.0,<2.0.0)
Project-URL: Documentation, https://gpflow.github.io/check_shapes
Project-URL: Repository, https://github.com/GPflow/check_shapes
Description-Content-Type: text/markdown

# check_shapes

`check_shapes` is a library for annotating and checking tensor shapes.
For example:

```python
import tensorflow as tf

from gpflow.experimental.check_shapes import check_shapes

@tf.function
@check_shapes(
    "features: [batch..., n_features]",
    "weights: [n_features]",
    "return: [batch...]",
)
def linear_model(features: tf.Tensor, weights: tf.Tensor) -> tf.Tensor:
    return tf.einsum("...i,i -> ...", features, weights)
```

For more information see our [documentation](https://gpflow.github.io/check_shapes).

## Installation

The recommended way to install `check_shapes` is from pypi:

```bash
pip install check_shapes
```

### From source

To develop `check_shapes`, check it out from GitHub:

```bash
git clone git@github.com:GPflow/check_shapes.git
```

We use [Poetry](https://python-poetry.org/) to install and manage dependencies. Follow their
instructions for how to install Poetry itself. Then:

```bash
cd check_shapes
poetry install
```

To check you installation run our tests:

```bash
poetry run task test
```

For testing with different versions of Python and dependencies, see the `poetryenv` script.
