提交 11e6848b 编写于 作者: S Smirnov Egor

add default order to transpose

上级 a6277370
......@@ -1644,6 +1644,16 @@ void ONNXImporter::parseTranspose(LayerParams& layerParams, const opencv_onnx::N
{
layerParams.type = "Permute";
replaceLayerParam(layerParams, "perm", "order");
if (!layerParams.has("order")) {
MatShape inpShape = outShapes[node_proto.input(0)];
size_t dims = inpShape.size();
std::vector<int> perm(dims);
for (size_t d = 0; d < dims; ++d)
{
perm[d] = static_cast<int>(dims - 1 - d);
}
layerParams.set("order", DictValue::arrayInt(perm.data(), perm.size()));
}
CV_Assert(node_proto.input_size() == 1);
if (constBlobs.find(node_proto.input(0)) != constBlobs.end())
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册