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

Gather->ShapeOf optimization fix #6006

Merged
merged 3 commits into from
Jun 3, 2021
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
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static bool simplify_gather_shapeof(shared_ptr<Node> node) {

auto zero_axis = opset3::Constant::create<int64_t>(element::i64, Shape{}, {0});
NodeVector new_ops;
auto new_shapeof = make_shared<opset3::ShapeOf>(gather->input_value(0));
auto new_shapeof = make_shared<opset3::ShapeOf>(gather->input_value(0), node->get_output_element_type(0));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add new tests?

new_ops.push_back(new_shapeof);
std::shared_ptr<Node> replace_op;
if (indices_rank.get_length() == 0) {
Expand All @@ -113,7 +113,7 @@ static bool simplify_gather_shapeof(shared_ptr<Node> node) {
new_ops.push_back(gather);
concat_inputs.push_back(gather);
}
auto shapeof_indices = make_shared<opset3::ShapeOf>(gather->input_value(1));
auto shapeof_indices = make_shared<opset3::ShapeOf>(gather->input_value(1), node->get_output_element_type(0));
new_ops.push_back(shapeof_indices);

concat_inputs.push_back(shapeof_indices);
Expand Down