# Defining New JAX Types with hijax for Custom Data Structures

> Hacker News story 48884100 · language: en · submitted 2026-07-12
> Web version: https://zeli.app/story/48884100
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 4 · by [fhchl](<https://news.ycombinator.com/user?id=fhchl>) · 💬 0
[original](<https://docs.jax.dev/en/latest/hijax_types.html>) · [HN discussion](<https://news.ycombinator.com/item?id=48884100>)

## Summary

I explore how hijax types in JAX let you define custom data structures with strict invariants, unlike standard pytrees. By subclassing HiType, you can control how values appear in traced code, manage unique tangent types for derivatives, and handle batching or sharding explicitly. This approach ensures your aggregate data maintains its identity and integrity throughout transformations.

## Key quote

> Some data is best modeled as a new type, with its own identity, rather than as a spray of array leaves.

---

## Cite

- Page: https://zeli.app/story/48884100
- Date: 2026-07-12
- Source: docs.jax.dev (https://docs.jax.dev/en/latest/hijax_types.html)
- Hacker News: https://news.ycombinator.com/item?id=48884100

## Other languages

- zh: https://zeli.app/zh/story/48884100 · markdown: https://zeli.app/zh/story/48884100.md
- ja: https://zeli.app/ja/story/48884100 · markdown: https://zeli.app/ja/story/48884100.md
- ko: https://zeli.app/ko/story/48884100 · markdown: https://zeli.app/ko/story/48884100.md
- de: https://zeli.app/de/story/48884100 · markdown: https://zeli.app/de/story/48884100.md
- es: https://zeli.app/es/story/48884100 · markdown: https://zeli.app/es/story/48884100.md
