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

Index fill pytorch #26488

Closed
wants to merge 18 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
CODE STYLE
  • Loading branch information
muhd360 committed Sep 14, 2024
commit 3a066218a408ae901c4ac6783f06d6fbc4c3a471
8 changes: 1 addition & 7 deletions src/frontends/pytorch/src/op/index_fill_.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ namespace pytorch {
namespace op {

OutputVector translate_index_fill_(const NodeContext& context) {

num_inputs_check(context, 4, 4);
auto input = context.get_input(0);
auto dim = context.get_input(1);
Expand All @@ -37,16 +36,11 @@ OutputVector translate_index_fill_(const NodeContext& context) {
auto tensor_rank_correct_type = context.mark_node(std::make_shared<v1::ConvertLike>(tensor_rank, dim));
auto positive_dim = normalize_axis(context, dim, tensor_rank_correct_type);


auto tensor_shape = context.mark_node(std::make_shared<v3::ShapeOf>(input, element::i32));
auto dim_vec = context.mark_node(std::make_shared<v1::Reshape>(positive_dim, const_1_vec, false));
auto broadcasted_index = context.mark_node(std::make_shared<v1::Broadcast>(index, tensor_shape, dim_vec));




auto result =
context.mark_node(std::make_shared<v12::ScatterElementsUpdate>(input, broadcasted_index, index, dim));
auto result = context.mark_node(std::make_shared<v12::ScatterElementsUpdate>(input, broadcasted_index, index, dim));
return {result};
};

Expand Down