Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Adding optional ops in contrib ops #7946
Adding optional ops in contrib ops #7946
Changes from 6 commits
fd89e5d
b80e6e7
f0b432a
2ae7d0a
0b1b33a
2103ea1
7b9b08c
770d318
d808c00
7884267
5e6f43d
b0dde05
94e4dcd
7d11c5f
1c949f2
b686bff
fca5ca8
f58ba11
596b00c
e3b253b
96a89fc
2324990
b704217
cb95fbb
69485fa
2e8aae4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
We already had optional(tensor(float)) at the beginning. Does this line should be removed or float -> bfloat16?
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.
ditto
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.
nit: Will it be prudent to think about making this operator more generic in the number of input operands it supports ? Can it support taking in 'N' inputs (the first one is necessary and N-1 are optional) to produce the same number of output booleans as the number of inputs ? That way we can avoid inserting this operator for every optional output coming from a layer (possibly gaining runtime advantages of just using one op vs many ops) ?
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.
So I spent some time thinking about this idea. So far I did not come up with an example for this feature among pytorch models and use-cases we've had. Do you have a specific code logic in mind.
Usually in the models, if there is a list with multiple optional elements, the list has dynamic length and it does not help to export it to an operator with fixed ('N') number of inputs.
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.
This could be done for any unary operator, in principle. But we don't have it for any existing unary operator, which is suggestive that this is not common enough? I think unless there is a use-case, my preference is to keep it simple.
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.
same comment as above
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.
This is needed for this PR.