Skip to content

Commit

Permalink
[onert-micro] fix wrong gru weight reset (#14093)
Browse files Browse the repository at this point in the history
- fix wrong gru reset logic by fixing memset size

ONE-DCO-1.0-Signed-off-by: Chunseok Lee <[email protected]>
  • Loading branch information
chunseoklee authored Sep 26, 2024
1 parent a0c0391 commit 50d75f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions onert-micro/onert-micro/include/pal/common/PALGRUWeightGrad.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ OMStatus GRUWeightGrads(
two_dim_output_shape.setDim(0, output_shape.dims(dim_count - 2));
two_dim_output_shape.setDim(1, output_shape.dims(dim_count - 1));

std::memset(weight_input_grad_data, 0, output_shape.flatSize() * sizeof(float) * time);
std::memset(weight_hidden_grad_data, 0, input_shape.dims(2) * sizeof(float) * time);
std::memset(weight_input_grad_data, 0, weight_input_shape.flatSize() * sizeof(float));
std::memset(weight_hidden_grad_data, 0, weight_hidden_shape.flatSize() * sizeof(float));

for (int i = 0; i < time; ++i)
{
Expand Down

0 comments on commit 50d75f2

Please sign in to comment.