Skip to main content

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 or jaxlib.xla_extension.XlaRuntimeError are raised. We cannot control error class consistently.
  • Even though catching errors, JAX automatically dumps stack traces, which might be annoying.

Metadata

Release files for jaxert 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jaxert 1.0.0
File Size Uploaded
jaxert-1.0.0.tar.gz 3.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jaxert 1.0.0
File Interpreter ABI Platform
jaxert-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.8 kB

Release files / jaxert-1.0.0.tar.gz

Download URL jaxert-1.0.0.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9362a009578baa8265d8b3ea725bda18df11840518f6a8bc06b808882298eea4
BLAKE2b-256 checksum
How to use checksums
f27bfad3766b8567f87436da3f8e59bd8a58f488e56bded5e310f7e2bd0007f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.5

Release files / jaxert-1.0.0-py3-none-any.whl

Download URL jaxert-1.0.0-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3235d037a0e870d2e60df1068761fd40f0fd8f2b9bc937350acfd76a74b61313
BLAKE2b-256 checksum
How to use checksums
4cbc6c8274075c039341cf25cef95c9548979387524043542c29e8741c5b1c7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.5

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page