提交 b3c9842a 编写于 作者: A Alexander Alekhin

Merge pull request #23287 from alalek:dnn_tflite_fix_illegal_access

......@@ -497,9 +497,8 @@ void TFLiteImporter::parseConcat(const Operator& op, const std::string& opcode,
DataLayout inpLayout = layouts[op.inputs()->Get(0)];
if (inpLayout == DATA_LAYOUT_NHWC) {
// OpenCV works in NCHW data layout. So change the axis correspondingly.
CV_Check(axis, -4 < axis && axis < 4, "");
int remap[] = {0, 2, 3, 1};
axis = axis > 0 ? axis : 4 + axis;
axis = normalize_axis(axis, 4);
static const int remap[] = {0, 2, 3, 1};
axis = remap[axis];
}
layerParams.set("axis", axis);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册