Skip to content

Commit 92f9eaa

Browse files
authored
Merge pull request #17 from GPflow/develop
Release 0.1.0
2 parents d3d1670 + 62f60d5 commit 92f9eaa

File tree

2 files changed

+79
-8
lines changed

2 files changed

+79
-8
lines changed

README.md

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,51 @@
11
# check_shapes
2-
Library for annotating and checking tensor shapes.
2+
3+
`check_shapes` is a library for annotating and checking tensor shapes.
4+
For example:
5+
6+
```python
7+
import tensorflow as tf
8+
9+
from gpflow.experimental.check_shapes import check_shapes
10+
11+
@tf.function
12+
@check_shapes(
13+
"features: [batch..., n_features]",
14+
"weights: [n_features]",
15+
"return: [batch...]",
16+
)
17+
def linear_model(features: tf.Tensor, weights: tf.Tensor) -> tf.Tensor:
18+
return tf.einsum("...i,i -> ...", features, weights)
19+
```
20+
21+
For more information see our [documentation](https://gpflow.github.io/check_shapes).
22+
23+
## Installation
24+
25+
The recommended way to install `check_shapes` is from pypi:
26+
27+
```bash
28+
pip install check_shapes
29+
```
30+
31+
### From source
32+
33+
To develop `check_shapes`, check it out from GitHub:
34+
35+
```bash
36+
git clone [email protected]:GPflow/check_shapes.git
37+
```
38+
39+
We use [Poetry](https://python-poetry.org/) to install and manage dependencies. Follow their
40+
instructions for how to install Poetry itself. Then:
41+
42+
```bash
43+
cd check_shapes
44+
poetry install
45+
```
46+
47+
To check you installation run our tests:
48+
49+
```bash
50+
poetry run task test
51+
```

pyproject.toml

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,33 @@
22
name = "check_shapes"
33
version = "0.1.0"
44
description = "A library for annotating and checking the shapes of tensors."
5-
authors = ["Jesper Nielsen <[email protected]>", "The GPflow Contributors"]
5+
authors = [
6+
"Jesper Nielsen <[email protected]>",
7+
"The GPflow Contributors",
8+
]
9+
license = "Apache-2.0"
10+
11+
readme = "README.md"
12+
homepage = "https://gpflow.github.io/check_shapes"
13+
repository = "https://github.com/GPflow/check_shapes"
14+
documentation = "https://gpflow.github.io/check_shapes"
15+
16+
classifiers = [
17+
"Development Status :: 4 - Beta",
18+
"Intended Audience :: Developers",
19+
"Intended Audience :: Education",
20+
"Intended Audience :: Science/Research",
21+
"License :: OSI Approved :: Apache Software License",
22+
"Programming Language :: Python :: 3",
23+
"Programming Language :: Python :: 3.7",
24+
"Programming Language :: Python :: 3.8",
25+
"Programming Language :: Python :: 3.9",
26+
"Programming Language :: Python :: 3.10",
27+
"Topic :: Scientific/Engineering",
28+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
29+
"Topic :: Software Development :: Debuggers",
30+
"Typing :: Typed",
31+
]
632

733
[tool.poetry.dependencies]
834
python = ">=3.7,<3.11"
@@ -43,15 +69,11 @@ python_version = "3.7"
4369
show_error_codes = true
4470
# First we turn on *all the checks*, and then we turn off those that are too annoying.
4571
strict = true
46-
# disallow_subclassing_any = false
47-
# disallow_untyped_calls = false
4872
disallow_untyped_decorators = false
49-
# ; This is needed because version 1.20.0 of NumPy introduces typing, so some ignores are necessary /
50-
# ; unnecessary depending on the version of numpy:
73+
# This is needed because version 1.20.0 of NumPy introduces typing, so some ignores are necessary /
74+
# unnecessary depending on the version of numpy:
5175
warn_unused_ignores = false
5276

53-
54-
5577
[[tool.mypy.overrides]]
5678
module = [
5779
"tensorflow.*",

0 commit comments

Comments
 (0)