From 87b7ce4415d3800f0f63801d9fad6ad71ae5f0b4 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 4 Aug 2023 21:57:22 +0200 Subject: [PATCH] Solved issue 24044 --- modules/dnn/src/layers/reduce_layer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/dnn/src/layers/reduce_layer.cpp b/modules/dnn/src/layers/reduce_layer.cpp index b983a791c5..77d8898df4 100644 --- a/modules/dnn/src/layers/reduce_layer.cpp +++ b/modules/dnn/src/layers/reduce_layer.cpp @@ -425,7 +425,7 @@ public: dtype* p_dst = dst.ptr(); size_t main_index = start / last_unreduced_dim; - size_t loop = start / last_unreduced_dim; + size_t loop = start % last_unreduced_dim; size_t origin = unprojected_steps[main_index] + loop * last_unreduced_step; for (int i = start; i < end; ++i) { Op accumulator(n_reduce, p_src[origin + projected_steps[0]]);