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;