Replies: 1 comment 1 reply
-
Very cool! I'll dig into this more when I have time. It looks like you've made it so named axis order matters? So arrays with names in different orders are distinct from the perspective of the API. That seems like a pretty big difference in mental model, I wonder how much that would affect how it feels to use. (I suppose you can always reorder right before you Also, I'm always a bit hesitant about types that have custom PyTree flattening / unflattening logic. Some constraints I noticed:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I've implemented a fork of Penzai using
tuple[str | None, ...]
for axis names:https://github.com/neuralgcm/neuralgcm/blob/715b2d6c6a4d2bb08c4cbdeb20d28ce43f957471/neuralgcm/experimental/coordax/named_axes.py
I like this model a little better, because it's simpler to understand and only includes a single NamedArray type.
This works with JAX's tree operations to handle operations like scan/vmap by allowing for inserting or trimming unnamed leading dimensions:
https://github.com/neuralgcm/neuralgcm/blob/715b2d6c6a4d2bb08c4cbdeb20d28ce43f957471/neuralgcm/experimental/coordax/named_axes.py#L443
Beta Was this translation helpful? Give feedback.
All reactions