Skip to content

Commit

Permalink
[onert] Remove unused variable in ShapeInference (#13409)
Browse files Browse the repository at this point in the history
This commit removes unused variable `num_reduce_axis` in ShapeInference.cc inferReduceShape() method.
`num_reduce_axis` is used to update itself only.

ONE-DCO-1.0-Signed-off-by: Hyeongseok Oh <[email protected]>
  • Loading branch information
hseok-oh authored Jul 12, 2024
1 parent 28f0853 commit c063aa7
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions runtime/onert/core/src/util/ShapeInference.cc
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ ir::Shape inferReduceShape(const ir::Shape &input_shape, const std::vector<int>
else
{
// Calculates size of reducing axis.
int num_reduce_axis = num_axis;
for (int i = 0; i < num_axis; ++i)
{
int current = axes[i];
Expand All @@ -204,22 +203,19 @@ ir::Shape inferReduceShape(const ir::Shape &input_shape, const std::vector<int>
}
if (current == previous)
{
--num_reduce_axis;
break;
}
}
}
// Determines output dimensions.
ir::Shape out_shape;
int num_skip_axis = 0;
for (int idx = 0; idx < input_num_dims; ++idx)
{
bool is_axis = false;
for (int axis_idx = 0; axis_idx < num_axis; ++axis_idx)
{
if (axes[axis_idx] == idx || axes[axis_idx] + input_num_dims == idx)
{
++num_skip_axis;
is_axis = true;
break;
}
Expand Down

0 comments on commit c063aa7

Please sign in to comment.