Skip to content
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

[shape_infer] Fix temporary axes remove from MatMul shape_infer #21474

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/core/shape_inference/include/matmul_shape_inference.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ std::vector<TRShape> shape_infer(const MatMul* op, const std::vector<T>& input_s
// Output shape of two 1D tensors multiplication will be a 0D tensor (scalar).
if (arg0_shape.rank().get_length() == 1) {
// arg0 input temporary axis inserted at ROW_INDEX_DIM is removed
output_shape.erase(output_shape.begin() + output_shape.size() - 2);
output_shape.erase(output_shape.begin() + (output_shape.size() - 2));
}
if (arg1_shape.rank().get_length() == 1) {
// arg1 input temporary axis inserted at COL_INDEX_DIM is removed
output_shape.erase(output_shape.begin() + output_shape.size() - 1);
output_shape.erase(std::prev(output_shape.end()));
}
output_shapes.emplace_back(std::move(output_shape));
return output_shapes;
Expand Down
Loading