-
Notifications
You must be signed in to change notification settings - Fork 158
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
[onert/core] Fix ShapeValidator of RmsNorm #14217
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1133,9 +1133,15 @@ void ShapeValidator::visit(const ir::operation::RmsNorm &node) | |
const auto ifm_index{node.getInputs().at(ir::operation::RmsNorm::Input::INPUT)}; | ||
const auto gamma_index{node.getInputs().at(ir::operation::RmsNorm::Input::GAMMA)}; | ||
|
||
OP_REQUIRES(operands.at(ifm_index).shape().rank() == 4); | ||
OP_REQUIRES(operands.at(ifm_index).shape() == operands.at(ofm_index).shape()); | ||
OP_REQUIRES(operands.at(gamma_index).shape().rank() == 1); | ||
auto ifm_shape = operands.at(ifm_index).shape(); | ||
auto ofm_shape = operands.at(ofm_index).shape(); | ||
auto gamma_shape = operands.at(gamma_index).shape(); | ||
|
||
OP_REQUIRES(ifm_shape.rank() == 3 || ifm_shape.rank() == 4); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IDK the background, Is there a reason to support input with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Current testing model has "rank = 3" inputs, like A x B x C. |
||
OP_REQUIRES(ifm_shape == ofm_shape); | ||
OP_REQUIRES(gamma_shape.rank() == 1); | ||
OP_REQUIRES((gamma_shape.dim(0) == 1) || | ||
(gamma_shape.dim(0) == ifm_shape.dim(ifm_shape.rank() - 1))); | ||
} | ||
|
||
} // namespace compiler | ||
|
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.
(optional) How about adding
const reference
?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.
Okay, I'll update it :)