Skip to content
This repository was archived by the owner on Aug 25, 2026. It is now read-only.

Allow hashable axis names in shape checks - #142

Closed
sylvesterkaczmarek wants to merge 1 commit into
google-deepmind:mainfrom
sylvesterkaczmarek:fix/shapecheck-hashable-axis-names
Closed

sylvesterkaczmarek wants to merge 1 commit into
google-deepmind:mainfrom
sylvesterkaczmarek:fix/shapecheck-hashable-axis-names

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Penzai named arrays support arbitrary hashable axis names, including TmpPosAxisMarker for temporary positional-axis bindings. check_structure still asserted that named-axis keys captured through an unpacked **var(...) binding were strings, both when inlining a solved mapping and when re-associating the final match result.

Remove those string-only assertions while preserving the existing matching logic.

Regression coverage includes repeated unpacked named-axis variables with a TmpPosAxisMarker and the Linear reproduction from issue #132.

Closes #132

@sylvesterkaczmarek
sylvesterkaczmarek marked this pull request as ready for review August 15, 2026 16:55
Penzai named arrays support arbitrary hashable axis names, including TmpPosAxisMarker for temporary positional-axis bindings. check_structure still asserted that named-axis keys captured through an unpacked **var(...) binding were strings, both when inlining a solved mapping and when re-associating the final match result.

Remove those string-only assertions while preserving the existing matching logic.

Regression coverage includes repeated unpacked named-axis variables with a TmpPosAxisMarker and the Linear reproduction from issue #132.

Closes #132
@sylvesterkaczmarek
sylvesterkaczmarek force-pushed the fix/shapecheck-hashable-axis-names branch from e796ff4 to 656055e Compare October 1, 2026 19:42
@sylvesterkaczmarek
sylvesterkaczmarek deleted the fix/shapecheck-hashable-axis-names branch October 7, 2026 16:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: pz.chk.check_structure erroneously requires all named array axes to be strings.

1 participant