From 01ba03415ac2237bbb4343162d34d71b6552eebb Mon Sep 17 00:00:00 2001 From: Chunseok Lee Date: Thu, 26 Sep 2024 14:31:15 +0900 Subject: [PATCH] [onert-micro] fix wrong gru weight reset - fix wrong gru reset logic by fixing memset size ONE-DCO-1.0-Signed-off-by: Chunseok Lee --- onert-micro/onert-micro/include/pal/common/PALGRUWeightGrad.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/onert-micro/onert-micro/include/pal/common/PALGRUWeightGrad.h b/onert-micro/onert-micro/include/pal/common/PALGRUWeightGrad.h index 1f3cd750c29..36303a1cfcb 100644 --- a/onert-micro/onert-micro/include/pal/common/PALGRUWeightGrad.h +++ b/onert-micro/onert-micro/include/pal/common/PALGRUWeightGrad.h @@ -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) {