Merge pull request #20556 from rogday:onnx_split_sum_fix

This commit is contained in:
Alexander Alekhin 2021-08-20 08:10:18 +00:00
commit a9817e9127
2 changed files with 2 additions and 1 deletions

View File

@ -851,7 +851,7 @@ void ONNXImporter::parseSplit(LayerParams& layerParams, const opencv_onnx::NodeP
std::vector<int> slicePoints(numSplits - 1, splits.get<int>(0));
for (int i = 1; i < splits.size() - 1; ++i)
{
slicePoints[i] = slicePoints[i - 1] + splits.get<int>(i - 1);
slicePoints[i] = slicePoints[i - 1] + splits.get<int>(i);
}
layerParams.set("slice_point", DictValue::arrayInt(&slicePoints[0], slicePoints.size()));
}

View File

@ -617,6 +617,7 @@ TEST_P(Test_ONNX_layers, Split)
testONNXModels("split_2");
testONNXModels("split_3");
testONNXModels("split_4");
testONNXModels("split_sizes");
}
TEST_P(Test_ONNX_layers, Slice)