-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[WebNN EP] Fix issues of GRU operator #22123
base: main
Are you sure you want to change the base?
Conversation
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.
LGTM, thanks!
onnxruntime/core/providers/webnn/builders/impl/gru_op_builder.cc
Outdated
Show resolved
Hide resolved
bool has_Y_h = output_defs.size() > 1 && output_defs[1]->Exists(); | ||
|
||
if (has_Y && !has_Y_h && GetType(*output_defs[0], Y_type, logger)) { | ||
return IsDataTypeSupportedByOp(op_type, Y_type, wnn_limits, "outputs", "Y", logger); |
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.
It may return early if this returns True
.
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.
Gru has two outputs (Y, Y_h). The if statement here enumerates all the cases. If the first if here returns True
, this is expected. WDYT?
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.
OK, but this would introduce duplicates GetType
for a single output.
How about just one by one check the outputs, and finally check if has both outputs, they should have same type.
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.
LGTM, thanks!
@fdwr PTAL, thanks a lot! |
Description
This PR fixes the spelling of the key value of the GRU operator in the map in the
GetSupportedNodes
function (Gru -> GRU) and removes the data type check for the fifth input (sequence_lens) of the GRU operator.PTAL, thanks!