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

functools.partialize the nnbench.parametrize decorators. #116

Merged
merged 1 commit into from
Mar 15, 2024
Merged

Conversation

maxmynter
Copy link
Collaborator

To use functools.partial for parametrize (and product) it is necessary to call the function returned by partial. Other- wise collection does not work.

Add these insights in the guide and example.

Closes #96

@maxmynter maxmynter force-pushed the partial branch 2 times, most recently from 6e8c959 to ae12603 Compare March 14, 2024 15:46
@nicholasjng
Copy link
Collaborator

Call it parametrize_label and you're good!

To use `functools.partial` for `parametrize` (and `product`)
it is necessary to call the function returned by `partial`. Other-
wise collection does not work.

Add these insights in the guide and example.
@maxmynter maxmynter merged commit fa05c66 into main Mar 15, 2024
5 checks passed
@nicholasjng nicholasjng deleted the partial branch March 18, 2024 14:45
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.

Make nnbench.parametrize work with functools.partial
2 participants