Skip to main content

Optix 🔍

A functional lensing library for JAX/Equinox, providing a way to focus on and modify nested values within PyTree structures. Optix generates the same HLO code as direct access, ensuring zero overhead.

Features

  • Type-safe lenses for any JAX PyTree structure
  • Zero runtime overhead (generates identical HLO code)
  • Intuitive API for accessing and modifying nested values
  • Complete static typing support

Example

from optix import focus
import jax.numpy as jnp

# Create a nested PyTree structure
data = MyStruct(
    x=jnp.array([1.0, 2.0]),
    nested=NestedStruct(y=jnp.array(3.0))
)

# Focus on and modify a nested value
result = focus(data).at(lambda x: x.nested.y).apply(jnp.square)
>>> MyStruct(
>>>     x=Array([1., 2.], dtype=float32),
>>>     nested=NestedStruct(
>>>         y=Array(9., dtype=float32)
>>>     )
>>> )

Installation

pip install jax-optix

License

MIT License

Credits

Special thanks to Patrick Kidger for providing helpful hints and the Equinox library, which this project builds upon.

Metadata

Release files for jax-optix 0.1.10

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

Source distribution (sdist)

Source distribution for jax-optix 0.1.10
File Size Uploaded Provenance Actions
jax_optix-0.1.10.tar.gz 4.0 kB Without provenance Details for jax_optix-0.1.10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jax-optix 0.1.10
File Interpreter ABI Platform Actions
jax_optix-0.1.10-py3-none-any.whl Python 3 none any Details for jax_optix-0.1.10-py3-none-any.whl

Total release size: 7.9 kB

Release files / jax_optix-0.1.10.tar.gz

Download URL jax_optix-0.1.10.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
29c0b9351a9d58b3101ba7ef75667b760ddcf5c350c5a0339df3ff0b888a210b
BLAKE2b-256 checksum
How to use checksums
46ea6139fd59a5ac1a0749766df598edd6195c57208ba686ac131270466db97b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.31

Release files / jax_optix-0.1.10-py3-none-any.whl

Download URL jax_optix-0.1.10-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
26931feef9faf4b1ceae0374c3c98efebd371d376c4639b08bdf5171b10c681e
BLAKE2b-256 checksum
How to use checksums
fabbd228b5b8a4446934518c40d754be4e98671b00beec840f880bcaa12aacd8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.31

Security for jax-optix 0.1.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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