-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[SOT][3.13] support closure #69753
base: develop
Are you sure you want to change the base?
[SOT][3.13] support closure #69753
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 3 out of 3 changed files in this pull request and generated no suggestions.
Comments skipped due to low confidence (1)
python/paddle/jit/sot/opcode_translator/executor/opcode_executor.py:1419
- The phrase 'can not' should be corrected to 'cannot'.
# can not set annotation in python env, skip it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flag = 0 | ||
else: | ||
flag = instr.arg | ||
if len(codeobj.get_py_value().co_freevars) > 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
后续考虑对 FunctionVariable
体系重构,以更加合适的方式来构造 function
PR Category
Execute Infrastructure
PR Types
Others
Description
MAKE_FUNCTION
需要支持下面几种情况, 当前方案并不完美,没有与 cpython 保持一致MAKE_FUNCTION
后跟随SET_FUNCTION_ATTRIBUTE
. 由于 closure 信息在此刻并不完整,所以无法使用types.FunctionType
创建 func, 为此创建了一个中间层UserCodeVariable
用于处理这类情况MAKE_FUNCTION
后不跟随SET_FUNCTION_ATTRIBUTE
SET_FUNCTION_ATTRIBUTE
后接着跟随SET_FUNCTION_ATTRIBUTE
TODO
test_19_closure