Skip to content

Commit 50d75f2

Browse files
authored
[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 <[email protected]>
1 parent a0c0391 commit 50d75f2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

onert-micro/onert-micro/include/pal/common/PALGRUWeightGrad.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ OMStatus GRUWeightGrads(
151151
two_dim_output_shape.setDim(0, output_shape.dims(dim_count - 2));
152152
two_dim_output_shape.setDim(1, output_shape.dims(dim_count - 1));
153153

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

157157
for (int i = 0; i < time; ++i)
158158
{

0 commit comments

Comments
 (0)