-
Notifications
You must be signed in to change notification settings - Fork 3.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
Allow new OpSchema
s to be initialized in Python
#5020
Conversation
f988429
to
0e50421
Compare
2fb734c
to
197f5c9
Compare
Signed-off-by: Justin Chu <justinchu@microsoft.com>
15acb03
to
ca227c1
Compare
ca227c1
to
60bf8c5
Compare
0aa9068
to
38bd1af
Compare
Signed-off-by: Justin Chu <justinchu@microsoft.com>
@jcwchen could you help add this to the milestone? |
Added. Please note that the code freeze date is 4/7. |
@edgchen1 When we move the strings from the pybind apis, will python lose access to them? Should I not use a value after it was moved? Edit: looks like they will be copied when the functions are being called? |
Signed-off-by: Justin Chu <justinchu@microsoft.com>
I will follow up with documentation updates to keep this PR manageable. Also so that we can merge faster and iterate on wording in the doc |
Also @gramalingam and @xadupre for review |
Since the string is passed by value, a string instance will be constructed (could be from a copy or a move from rvalue reference) for the argument. On the other hand, if it was passed by non-const reference, the caller might have to worry about it getting modified (e.g., moved from) even when the caller doesn't use
Right. Generally, for types that support moving, moved from objects are in a valid but unspecified state. You could do limited things with such an object, e.g., assign to it or destroy it. |
Signed-off-by: Justin Chu <justinchu@microsoft.com>
OpSchema
s to be initialized in Python
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.
Basically LGTM. Since it's a large important feature, please get approvals from more reviewers before merge. Thanks for the effort!
Note: next items after this PR -- add corresponding API documentation in .md files and on web (onnx.ai).
@xadupre for sig operator approval. Thanks! |
Signed-off-by: Justin Chu <justinchu@microsoft.com>
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.
looks good!
Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com> Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchu@microsoft.com>
Description
This PR needs to be in the 1.14 release
The change
OpSchema
,Attribute
,FormalParameter
andTypeConstraintParam
.Schema::Input
andSchema::Output
that takes aFormalParameter
FormalParameter
for API consistency. snake_case versions are created and exposed, but this will not break existing usage as the camelCase versions are still retained, just not annotated in the pyi file. So new users will only discover the snake_case versions.Code change
Next PRs
repr
methods for the classesMotivation and Context
#5019