From 50d75f27981da1c58a2f3a25e8a28623e3c5b270 Mon Sep 17 00:00:00 2001 From: chunseoklee Date: Thu, 26 Sep 2024 17:24:15 +0900 Subject: [PATCH] [onert-micro] fix wrong gru weight reset (#14093) - 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) {