No project description provided
Project description
JAXert: Assertion with JAX
JAXert provides simple assertions working with JAX.
These assertions are designed for testing.
Usage
jax_assert(cond)
assert_allclose(actual, desired)
Other options are described their docstrings.
Internals
To raise errors even in jitted functions,
we utilize jax.debug.callback
.
JAX has another mechanism checkify, where errors are converted to an additional return value containing error informations. The biggest disadvantage is that we have to handle such errors at outside jitted functions, which means we must change its call signature.
Known Limitations
- Depending on usages,
AssertionError
orjaxlib.xla_extension.XlaRuntimeError
are raised. We cannot control error class consistently. - Even though catching errors, JAX automatically dumps stack traces, which might be annoying.
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
jaxert-0.0.1.tar.gz
(3.0 kB
view details)
Built Distribution
File details
Details for the file jaxert-0.0.1.tar.gz
.
File metadata
- Download URL: jaxert-0.0.1.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68c517ae055040b68317fc4a580d5b9774043913c9735bb2e3746cc332af2771 |
|
MD5 | 4664e2a6dce88f5d67237c4b6adda2e3 |
|
BLAKE2b-256 | e40013818041ad213f28ad59543118b9183c121dd6f5e558a75494c7487d9106 |
File details
Details for the file jaxert-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: jaxert-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 118f4f5c87a932a379dfcb6c2f59ff0f6fcb04e580763c87787fa25886793b71 |
|
MD5 | 8207dde27926ea6c45ec8668893b3097 |
|
BLAKE2b-256 | ff9dad05af9226aa79a80a2fd22e92f9d6a1ec793e753ff9a1f1d815f31d593b |