Skip to main content

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 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jaxert-1.0.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

jaxert-1.0.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file jaxert-1.0.0.tar.gz.

File metadata

  • Download URL: jaxert-1.0.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for jaxert-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9362a009578baa8265d8b3ea725bda18df11840518f6a8bc06b808882298eea4
MD5 27ed737b594b674bd779a2a6db688881
BLAKE2b-256 f27bfad3766b8567f87436da3f8e59bd8a58f488e56bded5e310f7e2bd0007f5

See more details on using hashes here.

File details

Details for the file jaxert-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: jaxert-1.0.0-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

Hashes for jaxert-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3235d037a0e870d2e60df1068761fd40f0fd8f2b9bc937350acfd76a74b61313
MD5 7df7b7c5948ab33b67b5b3b35bcfdc23
BLAKE2b-256 4cbc6c8274075c039341cf25cef95c9548979387524043542c29e8741c5b1c7e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page