Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs custom rules #32

Merged
merged 6 commits into from
Oct 14, 2024
Merged

Conversation

vadmbertr
Copy link
Contributor

Hello,

I ran into a few problems trying to run the custom rules tutorial:

1

Encountered TypeError: '<' not supported between instances of 'Dimension' and 'Dimension' as JAX (v0.4.34 in my env.tries to sort pytrees dictionary keys when flattening. Added methods to allow comparing Dimension using their name attribute.

2

Noticed that

@quax.register(jax.lax.integer_pow_p)
def _(x: Unitful, *, y: int):
    units = {k: v * y for k, v in x.units.items()}
    return Unitful(x.array, units)

does not elevate x.array to the power of y. (incidentally fixes an inconsistent output)

3

Noticed that from jaxtyping import ArrayLike # https://github.com/patrick-kidger/quax does not use the correct URL.

Are you ok with the proposed changes?

Vadim

@patrick-kidger patrick-kidger merged commit 166266f into patrick-kidger:main Oct 14, 2024
2 checks passed
@patrick-kidger
Copy link
Owner

These fixes all look good to me! Thank you for the pull request - merged :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants