1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Merge pull request #28121 from abhishek-gola:loop_layer_add

Add Loop layer to new DNN engine #28121

Addition of loop layer in 5.x for issue: https://github.com/opencv/opencv/issues/26179 and https://github.com/opencv/opencv/issues/26141 and https://github.com/opencv/opencv/issues/25200

OpenCV Extra: https://github.com/opencv/opencv_extra/pull/1335

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
Abhishek Gola
2026-04-14 11:45:46 +05:30
committed by GitHub
parent 3d77645a3a
commit de851d24a5
14 changed files with 393 additions and 32 deletions
+8
View File
@@ -1209,6 +1209,14 @@ void broadcast(InputArray _src, InputArray _shape, OutputArray _dst) {
}
// other cases
int max_ndims = std::max(dims_src, dims_shape);
if (max_ndims < 2 && src.total() == 1) {
const char* p_src = src.ptr<const char>();
char* p_dst = dst.ptr<char>();
size_t esz = src.elemSize();
for (size_t j = 0; j < dst.total(); j++)
std::memcpy(p_dst + j * esz, p_src, esz);
return;
}
const int all_ndims[2] = {src.dims, dst.dims};
const int* orig_shapes[2] = {src.size.p, dst.size.p};
cv::AutoBuffer<size_t> buff(max_ndims * 4);