Files
opencv-MIRROR/modules
Shiven Solanki 9c6d1ababb dnn: return an empty shape in Shape when start > end (#31011)
* dnn: return an empty shape in Shape when start > end

* dnn: apply the Shape start > end rule to the CUDA backend

* dnn: skip test_shape_start_greater_than_end in the OpenVINO filter

Problem
ShapeLayerImpl::getShapeRange asserts start_ <= end_, so Shape with start > end throws. The ONNX spec says the result should be an empty shape.

Fix
After clamping, set end_ = std::max(end_, start_) so the range has length 0. This
2026-11-24 13:36:58 +05:30
..
2026-07-09 12:17:24 +03:00