onnx / optimizer

Actively maintained ONNX Optimizer
Apache License 2.0
647 stars 90 forks source link

3 concatenations at the same time? #146

Open johnnynunez opened 12 months ago

johnnynunez commented 12 months ago

Most of the problems of edge devices is that onnx not simplifies concatenations. If we have 3 inputs at the same time, causes problems. So solutions I think that can be modify the original model at the position corresponding to 3 concatenations to use two parallel Concat structures. For example, if the input nodes are A, B, C and the output is Concat(A, B, C), modify it to Concat(Concat(A, B), C). Specify the specific dimensions for the reshape operation in this process to avoid abnormal precision caused by automatic inference.