Merge pull request #24751 from dkurt:d.kurtaev/hotfix_cuda_scale

[CUDA] Hotfix Scale with 1 parameter
This commit is contained in:
Alexander Smorkalov 2023-12-22 16:52:50 +03:00 committed by GitHub
commit f399bdfa1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -128,6 +128,9 @@ namespace cv { namespace dnn { namespace cuda4dnn {
/* the scale shift operation might require broadcasting */
const int end_axis = [&] {
if (num_parameters == 1) {
return static_cast<int>(axis + 1);
}
for (int endAxis = axis + 1; endAxis <= input.rank(); endAxis++) {
if (input.size_range(axis, endAxis) == mid_size)
return endAxis;