mirror of
https://github.com/opencv/opencv.git
synced 2025-07-24 14:06:27 +08:00
support broadcast on axis > 1 for Expand
This commit is contained in:
parent
f5a92cb43f
commit
88cacd35c5
@ -2529,8 +2529,11 @@ void ONNXImporter::parseExpand(LayerParams& layerParams, const opencv_onnx::Node
|
||||
node_proto.set_input(0, constParams.name);
|
||||
node_proto.set_input(1, srcName);
|
||||
}
|
||||
else if (broadcast_axes.size() == 1 && broadcast_axes[0] <= 1)
|
||||
else if (broadcast_axes.size() == 1)
|
||||
{
|
||||
// FIXME: this will end up creating massive amount of Identity nodes for broadcasting,
|
||||
// for example, broadcast 1 to 256 needs 256 Identity nodes and 1 Concat node.
|
||||
// Possible improvement is to use "Scale".
|
||||
expandMid(layerParams.name, node_proto, srcName, targetShape[broadcast_axes[0]]);
|
||||
|
||||
layerParams.set("axis", broadcast_axes[0]);
|
||||
|
Loading…
Reference in New Issue
Block a user