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

register scaled op as decorator #9

Merged
merged 3 commits into from
Nov 9, 2023
Merged

register scaled op as decorator #9

merged 3 commits into from
Nov 9, 2023

Conversation

lyprince
Copy link
Contributor

@lyprince lyprince commented Nov 9, 2023

It might get tedious to write the register function every time you add a scaled op.

Here's a suggestion for doing it as a decorator instead.

Copy link
Contributor

@balancap balancap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @lyprince
Personally, not the biggest fan of Python decorator, but nothing against making it easier as well to register standard jax.lax scaled ops. The main thing: it should be a nice addon on top of the existing register mechanism, not replacing it

jax_scaled_arithmetics/core/interpreters.py Outdated Show resolved Hide resolved
jax_scaled_arithmetics/core/interpreters.py Outdated Show resolved Hide resolved
jax_scaled_arithmetics/core/interpreters.py Outdated Show resolved Hide resolved
@balancap
Copy link
Contributor

balancap commented Nov 9, 2023

Great! Thanks @lyprince , merging!

@balancap balancap merged commit b90436f into main Nov 9, 2023
2 checks passed
@balancap balancap deleted the register_decorator branch November 9, 2023 13:27
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