Merge pull request #24865 from asmorkalov:as/dnn_concat_assert

Normalize axis parameter in DNN Concat to handle negative values
This commit is contained in:
Alexander Smorkalov 2024-01-16 14:39:28 +03:00 committed by GitHub
commit 84bb1cda4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -2617,6 +2617,7 @@ void ONNXImporter::parseConcat(LayerParams& layerParams, const opencv_onnx::Node
// Concat-1 has default value for axis is 1: https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Concat-1
int axis = layerParams.get<int>("axis", 1);
axis = normalize_axis(axis, inputShape.size());
for (size_t i = 0; i < inputs.size(); ++i)
{
MatShape targetShape = inputShape;

View File

@ -41,7 +41,7 @@
"test_cast_STRING_to_FLOAT",
"test_castlike_FLOAT_to_STRING_expanded",
"test_castlike_STRING_to_FLOAT_expanded",
"test_concat_1d_axis_negative_1",
"test_concat_1d_axis_negative_1", // 1d support is required
"test_div_uint8", // output type mismatch
"test_maxpool_2d_dilations",
"test_maxpool_2d_same_lower",