DALI
DALI copied to clipboard
Remove redundant wrapper from autograph.do_not_convert
Category:
Bug fix (non-breaking change which fixes an issue)
Description:
Autograph's do_not_convert changes the functions signature and __code__. This isn't necessary. The with statement is redundant; it goes down the same road as is_autograph_artifact, and do_not_convert can mark the function as such.
See api.h:
if ag_ctx.control_status_ctx().status == ag_ctx.Status.DISABLED:
logging.log(2, "Allowlisted: %s: AutoGraph is disabled in context", f)
return _call_unconverted(f, args, kwargs, options, False)
if is_autograph_artifact(f):
logging.log(2, "Permanently allowed: %s: AutoGraph artifact", f)
return _call_unconverted(f, args, kwargs, options)
Thus, simply marking the original function as autograph artifact (or possibly coming up with a different, specific marker) is indeed enough.
Additional information:
Affected modules and functionalities:
Autograph
Key points relevant for the review:
Tests:
See #5268
- [ ] Existing tests apply
- [ ] New tests added
- [ ] Python tests
- [ ] GTests
- [ ] Benchmark
- [ ] Other
- [ ] N/A
Checklist
Documentation
- [ ] Existing documentation applies
- [ ] Documentation updated
- [ ] Docstring
- [ ] Doxygen
- [ ] RST
- [ ] Jupyter
- [ ] Other
- [ ] N/A
DALI team only
Requirements
- [ ] Implements new requirements
- [ ] Affects existing requirements
- [ ] N/A
REQ IDs: N/A
JIRA TASK: N/A
CI MESSAGE: [11954919]: BUILD STARTED
CI MESSAGE: [11954919]: BUILD FAILED
We added the do_not_convert decorator in another PR.