tsingmicro-toolchain / OnnxSlim

A Toolkit to Help Optimize Large Onnx Model
MIT License
149 stars 9 forks source link

Wrong input tensor ID in case the original tensor source node is a graph output #33

Open FeKrtz opened 1 week ago

FeKrtz commented 1 week ago

There is an operation in the original model that uses a tensor which is also an output tensor of the graph:

example: orig

slimmed: slimmed

The input B is expected to be: something like: "_normalization_2d_axis0_expanded_function_Mean2D" but the output is identified as "Mean" The connection between these two is not made in the optimized graph.

The model can be found here: https://github.com/onnx/onnx/tree/main/onnx/backend/test/data/node/test_layer_normalization_2d_axis0_expanded_ver18

best regards and thanks for your great tool!

inisis commented 1 week ago

Thanks for your findings! I will fix this soon.