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

Add compact_name_scope decorator #3621

Merged
merged 1 commit into from
Jan 22, 2024
Merged

Add compact_name_scope decorator #3621

merged 1 commit into from
Jan 22, 2024

Conversation

cgarciae
Copy link
Collaborator

@cgarciae cgarciae commented Jan 12, 2024

What does this PR do?

Adds the nn.compact_name_scope decorator that enables methods to act as compact name scopes as with regular Haiku methods, this makes porting Haiku code easier.

@cgarciae cgarciae force-pushed the nontransparent branch 3 times, most recently from 780c9b4 to 4a418b8 Compare January 12, 2024 21:48
flax/linen/module.py Outdated Show resolved Hide resolved
@cgarciae cgarciae changed the title Add nontransparent decorator Add compact_name_scope decorator Jan 18, 2024
Copy link
Collaborator

@marcvanzee marcvanzee left a comment

Choose a reason for hiding this comment

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

Really useful addition! Just a nit on the docstring but other than that looks great!

flax/linen/module.py Show resolved Hide resolved
@copybara-service copybara-service bot merged commit 7e9bb76 into main Jan 22, 2024
21 checks passed
@copybara-service copybara-service bot deleted the nontransparent branch January 22, 2024 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants