Name | ezjaxtyping JSON |
Version |
0.2.20
JSON |
| download |
home_page | None |
Summary | Type annotations and runtime checking for shape and dtype of JAX arrays, and PyTrees. |
upload_time | 2023-07-20 18:27:43 |
maintainer | None |
docs_url | None |
author | None |
requires_python | ~=3.8 |
license | MIT License
Copyright (c) 2022 Google LLC
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
---
Sections of the code were modified from https://github.com/agronholm/typeguard
under the terms of the MIT license, reproduced below.
---
MIT License
Copyright (c) Alex Grönholm
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. |
keywords |
deep-learning
equinox
jax
neural-networks
typing
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<h1 align="center">jaxtyping</h1>
# IMPORTANT: this relaxes the python constraint to python3.8 to be installable with [eztils](https://github.com/ezhang7423/eztils), but will throw a RuntimeError if you actually try to run with python3.8.
Type annotations **and runtime type-checking** for:
1. shape and dtype of [JAX](https://github.com/google/jax) arrays; *(Now also supports PyTorch, NumPy, and TensorFlow!)*
2. [PyTrees](https://jax.readthedocs.io/en/latest/pytrees.html).
**For example:**
```python
from jaxtyping import Array, Float, PyTree
# Accepts floating-point 2D arrays with matching dimensions
def matrix_multiply(x: Float[Array, "dim1 dim2"],
y: Float[Array, "dim2 dim3"]
) -> Float[Array, "dim1 dim3"]:
...
def accepts_pytree_of_ints(x: PyTree[int]):
...
def accepts_pytree_of_arrays(x: PyTree[Float[Array, "batch c1 c2"]]):
...
```
## Installation
```bash
pip install jaxtyping
```
Requires Python 3.9+.
JAX is an optional dependency, required for a few JAX-specific types. If JAX is not installed then these will not be available, but you may still use jaxtyping to provide shape/dtype annotations for PyTorch/NumPy/TensorFlow/etc.
The annotations provided by jaxtyping are compatible with runtime type-checking packages, so it is common to also install one of these. The two most popular are [typeguard](https://github.com/agronholm/typeguard) (which exhaustively checks every argument) and [beartype](https://github.com/beartype/beartype) (which checks random pieces of arguments).
## Documentation
Available at [https://docs.kidger.site/jaxtyping](https://docs.kidger.site/jaxtyping).
## Finally
### See also: other libraries in the JAX ecosystem
[Equinox](https://github.com/patrick-kidger/equinox): neural networks.
[Optax](https://github.com/deepmind/optax): first-order gradient (SGD, Adam, ...) optimisers.
[Diffrax](https://github.com/patrick-kidger/diffrax): numerical differential equation solvers.
[Lineax](https://github.com/google/lineax): linear solvers and linear least squares.
[Eqxvision](https://github.com/paganpasta/eqxvision): computer vision models.
[sympy2jax](https://github.com/google/sympy2jax): SymPy<->JAX conversion; train symbolic expressions via gradient descent.
[Levanter](https://github.com/stanford-crfm/levanter): scalable+reliable training of foundation models (e.g. LLMs).
### Disclaimer
This is not an official Google product.
Raw data
{
"_id": null,
"home_page": null,
"name": "ezjaxtyping",
"maintainer": null,
"docs_url": null,
"requires_python": "~=3.8",
"maintainer_email": null,
"keywords": "deep-learning,equinox,jax,neural-networks,typing",
"author": null,
"author_email": "Eddie Zhang <futzipecinematography@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/00/86/fe8f5de46329268db82473a79f7b5ca8027c5eb11e4bbf1048e86dc5a3a3/ezjaxtyping-0.2.20.tar.gz",
"platform": null,
"description": "<h1 align=\"center\">jaxtyping</h1>\n\n# IMPORTANT: this relaxes the python constraint to python3.8 to be installable with [eztils](https://github.com/ezhang7423/eztils), but will throw a RuntimeError if you actually try to run with python3.8.\n\nType annotations **and runtime type-checking** for:\n\n1. shape and dtype of [JAX](https://github.com/google/jax) arrays; *(Now also supports PyTorch, NumPy, and TensorFlow!)*\n2. [PyTrees](https://jax.readthedocs.io/en/latest/pytrees.html).\n\n\n**For example:**\n```python\nfrom jaxtyping import Array, Float, PyTree\n\n# Accepts floating-point 2D arrays with matching dimensions\ndef matrix_multiply(x: Float[Array, \"dim1 dim2\"],\n y: Float[Array, \"dim2 dim3\"]\n ) -> Float[Array, \"dim1 dim3\"]:\n ...\n\ndef accepts_pytree_of_ints(x: PyTree[int]):\n ...\n\ndef accepts_pytree_of_arrays(x: PyTree[Float[Array, \"batch c1 c2\"]]):\n ...\n```\n\n## Installation\n\n```bash\npip install jaxtyping\n```\n\nRequires Python 3.9+.\n\nJAX is an optional dependency, required for a few JAX-specific types. If JAX is not installed then these will not be available, but you may still use jaxtyping to provide shape/dtype annotations for PyTorch/NumPy/TensorFlow/etc.\n\nThe annotations provided by jaxtyping are compatible with runtime type-checking packages, so it is common to also install one of these. The two most popular are [typeguard](https://github.com/agronholm/typeguard) (which exhaustively checks every argument) and [beartype](https://github.com/beartype/beartype) (which checks random pieces of arguments).\n\n## Documentation\n\nAvailable at [https://docs.kidger.site/jaxtyping](https://docs.kidger.site/jaxtyping).\n\n## Finally\n\n### See also: other libraries in the JAX ecosystem\n\n[Equinox](https://github.com/patrick-kidger/equinox): neural networks.\n\n[Optax](https://github.com/deepmind/optax): first-order gradient (SGD, Adam, ...) optimisers.\n\n[Diffrax](https://github.com/patrick-kidger/diffrax): numerical differential equation solvers.\n\n[Lineax](https://github.com/google/lineax): linear solvers and linear least squares.\n\n[Eqxvision](https://github.com/paganpasta/eqxvision): computer vision models.\n\n[sympy2jax](https://github.com/google/sympy2jax): SymPy<->JAX conversion; train symbolic expressions via gradient descent.\n\n[Levanter](https://github.com/stanford-crfm/levanter): scalable+reliable training of foundation models (e.g. LLMs).\n\n### Disclaimer\n\nThis is not an official Google product.\n",
"bugtrack_url": null,
"license": "MIT License\n \n Copyright (c) 2022 Google LLC\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n \n \n \n \n ---\n Sections of the code were modified from https://github.com/agronholm/typeguard\n under the terms of the MIT license, reproduced below.\n ---\n \n MIT License\n \n Copyright (c) Alex Gr\u00f6nholm\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.",
"summary": "Type annotations and runtime checking for shape and dtype of JAX arrays, and PyTrees.",
"version": "0.2.20",
"project_urls": {
"repository": "https://github.com/ezhang7423/relaxed-jaxtyping"
},
"split_keywords": [
"deep-learning",
"equinox",
"jax",
"neural-networks",
"typing"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "a1b2bb7d6534c83419d42410ace10faacc116646442cb19b4371b53e36f8ca84",
"md5": "fe5b23ccc97db5cd619533f375d6b278",
"sha256": "466f483aec7265fe60cf622592861d64fb73b2f0d1bbc7cdbcef63e22e422116"
},
"downloads": -1,
"filename": "ezjaxtyping-0.2.20-py3-none-any.whl",
"has_sig": false,
"md5_digest": "fe5b23ccc97db5cd619533f375d6b278",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "~=3.8",
"size": 25054,
"upload_time": "2023-07-20T18:27:45",
"upload_time_iso_8601": "2023-07-20T18:27:45.943169Z",
"url": "https://files.pythonhosted.org/packages/a1/b2/bb7d6534c83419d42410ace10faacc116646442cb19b4371b53e36f8ca84/ezjaxtyping-0.2.20-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "0086fe8f5de46329268db82473a79f7b5ca8027c5eb11e4bbf1048e86dc5a3a3",
"md5": "8cb142baa917186cc456de4a10df8962",
"sha256": "aaa2396bdb515516903fb1aa73a22d53e8d79e5bdd68ac16b47805930692e291"
},
"downloads": -1,
"filename": "ezjaxtyping-0.2.20.tar.gz",
"has_sig": false,
"md5_digest": "8cb142baa917186cc456de4a10df8962",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "~=3.8",
"size": 17521,
"upload_time": "2023-07-20T18:27:43",
"upload_time_iso_8601": "2023-07-20T18:27:43.778158Z",
"url": "https://files.pythonhosted.org/packages/00/86/fe8f5de46329268db82473a79f7b5ca8027c5eb11e4bbf1048e86dc5a3a3/ezjaxtyping-0.2.20.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-20 18:27:43",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ezhang7423",
"github_project": "relaxed-jaxtyping",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "ezjaxtyping"
}