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

transform callables wrap original qfunc #5857

Merged
merged 3 commits into from
Jun 14, 2024

Conversation

albi3ro
Copy link
Contributor

@albi3ro albi3ro commented Jun 14, 2024

Context:

Issue #5843 made me realize when we apply a transform to a qfunc callable, we should use functools.wraps to preserve the docstring and signature of the original function.

Description of the Change:

Adds functools.wraps to the transformed qfunc.

Benefits:

transformed qfunc's keep information about the original function.

Possible Drawbacks:

Related GitHub Issues:

Fixes #5843

Copy link
Contributor

@dwierichs dwierichs left a comment

Choose a reason for hiding this comment

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

Nice!

Copy link
Contributor

@PietropaoloFrisoni PietropaoloFrisoni left a comment

Choose a reason for hiding this comment

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

Thanks! I cannot find inspect among the required packages, but looks like is already used everywhere in the source code

@albi3ro
Copy link
Contributor Author

albi3ro commented Jun 14, 2024

Thanks! I cannot find inspect among the required packages, but looks like is already used everywhere in the source code

inspect is a built in python package.

@albi3ro albi3ro added the merge-ready ✔️ All tests pass and the PR is ready to be merged. label Jun 14, 2024
@albi3ro albi3ro enabled auto-merge (squash) June 14, 2024 15:27
Copy link

codecov bot commented Jun 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.67%. Comparing base (9b3060f) to head (073ba31).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5857      +/-   ##
==========================================
- Coverage   99.67%   99.67%   -0.01%     
==========================================
  Files         421      421              
  Lines       40189    39894     -295     
==========================================
- Hits        40060    39764     -296     
- Misses        129      130       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@albi3ro albi3ro merged commit f73a365 into master Jun 14, 2024
39 checks passed
@albi3ro albi3ro deleted the transforms-dispatcher-qfunc-wraps branch June 14, 2024 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-ready ✔️ All tests pass and the PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broadcast Expand Prevents Torchlayer from detecting Inputs Argument
3 participants