提交 d392b11d 编写于 作者: L Liubov Batanina

Supported ONNX Pow op

上级 8c1af099
......@@ -712,6 +712,19 @@ void ONNXImporter::populateNet(Net dstNet)
layerParams.set("bias_term", true);
}
}
else if (layer_type == "Pow")
{
if (layer_id.find(node_proto.input(1)) != layer_id.end())
CV_Error(Error::StsNotImplemented, "Unsupported Pow op with variable power");
Mat blob = getBlob(node_proto, constBlobs, 1);
if (blob.total() != 1)
CV_Error(Error::StsNotImplemented, "Pow op supports only scalar power");
blob.convertTo(blob, CV_32F);
layerParams.type = "Power";
layerParams.set("power", blob.at<float>(0));
}
else if (layer_type == "Max")
{
layerParams.type = "Eltwise";
......
......@@ -283,6 +283,11 @@ TEST_P(Test_ONNX_layers, Cast)
testONNXModels("cast");
}
TEST_P(Test_ONNX_layers, Power)
{
testONNXModels("pow2", npy, 0, 0, false, false);
}
TEST_P(Test_ONNX_layers, Concatenation)
{
if (backend == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册