Skip to main content

Hy bindings for JAX

Project description

Hyjax

pip install hyjax

Hyjax is Hy bindings for JAX.

When walking about the countryside of Italy, the people will not hesitate to tell you that JAX has “una anima di pura programmazione funzionale”. –– 🔪 JAX - The Sharp Bits 🔪

“As one would expect from its goals, artificial intelligence research generates many significant programming problems. In other programming cultures this spate of problems spawns new languages. ... We toast the Lisp programmer who pens his thoughts within nests of parentheses.” -- Alan J. Perlis

You now know enough to be dangerous with Hy. You may now smile villainously and sneak off to your Hydeaway to do unspeakable things. –– Hy Tutorial

The goals are

  1. the name pun was funny
  2. let fully JIT-compiled JAX code be written in idiomatic Lisp

Some examples loosely inspired by the JAX Quickstart tutorials are in src/experiments.hy. The Hy and JAX docs might also be helpful.

Features

  • (mapv f vec) as vmap(f)(vec)
  • (if/ja pred then else) as lax.cond
  • (defn/j f [args] body) as @jit def f(args): ...
    • identical syntax to Hy's defn; supports other decorators, annotations, variadic & keyword args
  • (if pred then else) inside defn/j as lax.cond
    • works with any macros that compile to if, such as cond
  • binding for lax.while_loop
  • binding for lax.fori_loop

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

hyjax-0.1.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hyjax-0.1.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file hyjax-0.1.0.tar.gz.

File metadata

  • Download URL: hyjax-0.1.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.9

File hashes

Hashes for hyjax-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6462c1785a60db8c41bff36b3707610064b3b408b3071a37b3a561efed905f0b
MD5 37fc2a33560d407ab16d87861eec4072
BLAKE2b-256 220d3e828241339d8eb3bade97e3128cb042d2f41506ba1985673f486d280664

See more details on using hashes here.

File details

Details for the file hyjax-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: hyjax-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.9

File hashes

Hashes for hyjax-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ff9413e0febb065daad05e6ef3c44a3b4d9c9d67789f6734fbbb9fbe68dde049
MD5 83c6ea2d530a28437844c10da0c9699e
BLAKE2b-256 19bf0495b8d25c380d909ab478569565b507f9e4d0beb9f84c2c51dd9dbd268e

See more details on using hashes here.

Supported by

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