projects
/
platform
/
upstream
/
opencv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a627737
)
add sum of 1 input
author
Smirnov Egor
<s.e.a.98@yandex.ru>
Tue, 30 Nov 2021 12:42:20 +0000
(15:42 +0300)
committer
Smirnov Egor
<s.e.a.98@yandex.ru>
Tue, 30 Nov 2021 12:42:20 +0000
(15:42 +0300)
modules/dnn/src/onnx/onnx_importer.cpp
patch
|
blob
|
history
diff --git
a/modules/dnn/src/onnx/onnx_importer.cpp
b/modules/dnn/src/onnx/onnx_importer.cpp
index
d70a81b
..
7af095e
100644
(file)
--- a/
modules/dnn/src/onnx/onnx_importer.cpp
+++ b/
modules/dnn/src/onnx/onnx_importer.cpp
@@
-929,6
+929,14
@@
void ONNXImporter::parseBias(LayerParams& layerParams, const opencv_onnx::NodePr
opencv_onnx::NodeProto node_proto = node_proto_;
const std::string& layer_type = node_proto.op_type();
bool isSub = layer_type == "Sub";
+
+ if (layer_type == "Sum" && node_proto.input_size() == 1)
+ {
+ layerParams.type = "Identity";
+ addLayer(layerParams, node_proto);
+ return;
+ }
+
CV_Assert((node_proto.input_size() == 2) || (layer_type == "Sum" && node_proto.input_size() > 2));
if (layer_type == "Sum" && node_proto.input_size() > 2)