
Product
Announcing Precomputed Reachability Analysis in Socket
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
.. This file is generated from index.rst and should not be modified directly.
.. image:: https://github.com/tillahoffmann/ifnt/actions/workflows/build.yml/badge.svg :target: https://github.com/tillahoffmann/ifnt/actions/workflows/build.yml .. image:: https://readthedocs.org/projects/ifnt/badge/?version=latest :target: https://ifnt.readthedocs.io/en/latest/?badge=latest .. image:: https://img.shields.io/pypi/v/jax-ifnt :target: https://pypi.org/project/jax-ifnt
Execute runtime assertions, indexing checks, and more if :code:jax
code is not traced.
ifnt comprises three core modules, :code:ifnt.util
with utility functions, :code:ifnt.testing
for runtime assertions, and :code:ifnt.random
for stateful random number generation.
>>> import ifnt
>>> import jax
>>> from jax import numpy as jnp
>>>
>>> def safe_log(x):
... ifnt.testing.assert_array_less(0, x)
... return jnp.log(x)
>>>
>>> safe_log(-1)
Traceback (most recent call last):
...
AssertionError: Arrays are not strictly ordered `x < y`
<BLANKLINE>
Mismatched elements: 1 / 1 (100%)
Max absolute difference among violations: 1
Max relative difference among violations: 1.
x: array(0)
y: array(-1)
>>>
>>> jax.jit(safe_log)(-1)
Array(nan, dtype=float32, weak_type=True)
.. code-block:: bash
$ pip install jax-ifnt
DeepMind's chex <https://github.com/google-deepmind/chex>
_ provides similar, often complementary, assertions. While chex requires runtime assertions to be "functionalized" with :code:chex.chexify
, ifnt will skip assertions in traced code. This facilitates, for example, verifying that indices are not out of bounds.
.. End of autogenerated file.
FAQs
Execute runtime assertions, indexing checks, and more if jax code is not traced.
We found that jax-ifnt demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.