From b7d70613e431a5f8875001bc590d72d710429954 Mon Sep 17 00:00:00 2001 From: Yuantao Feng Date: Fri, 5 Jan 2024 18:33:01 +0000 Subject: [PATCH] fix failed assertion in debug build --- modules/dnn/perf/perf_layer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/dnn/perf/perf_layer.cpp b/modules/dnn/perf/perf_layer.cpp index 3e477da125..ad3bd4c223 100644 --- a/modules/dnn/perf/perf_layer.cpp +++ b/modules/dnn/perf/perf_layer.cpp @@ -350,6 +350,7 @@ PERF_TEST_P_(Layer_ScatterND, scatterND) { indices_step.push_back(step); } int t, j, idx, offset_at_idx, offset; + auto *indices_ptr = indices.ptr(); for (int i = 0; i < total; i++) { t = i; @@ -366,7 +367,7 @@ PERF_TEST_P_(Layer_ScatterND, scatterND) { offset += current_index_tuple[j] * indices_step[j]; for (j = 0; j < shape.size(); j++) - indices.at(offset + j) = current_index_tuple[j]; + indices_ptr[offset + j] = current_index_tuple[j]; } Net net;