Self-Created Tools to convert ONNX files (NCHW) to TensorFlow/TFLite/Keras format (NHWC). The purpose of this tool is to solve the massive Transpose extrapolation problem in onnx-tensorflow (onnx-tf). I don't need a Star, but give me a pull request.
MIT License
662
stars
65
forks
source link
support suppressing flex ops for MatMulInteger #634
Currently, MatMulInteger is implemented as tf matmul with int32 inputs/outputs, which leads to generation of Flex(Batch)MatMul ops.
2. Summary of corrections
When -rtpo MatMulInteger is specified, inputs of MatMulInteger are casted to float32 instead, allowing the node to be converted to the builtin FullyConnected or BatchMatMul ops.
3. Before/After (If there is an operating log that can be used as a reference)
ONNX input:
Before:
After:
4. Issue number (only if there is a related issue)
1. Content and background
Currently, MatMulInteger is implemented as tf matmul with int32 inputs/outputs, which leads to generation of Flex(Batch)MatMul ops.
2. Summary of corrections
When
-rtpo MatMulInteger
is specified, inputs of MatMulInteger are casted to float32 instead, allowing the node to be converted to the builtin FullyConnected or BatchMatMul ops.3. Before/After (If there is an operating log that can be used as a reference)
ONNX input:![image](https://github.com/PINTO0309/onnx2tf/assets/25856103/25c91c62-1b3e-4ca4-b541-1cd59db7f39b)
Before:![Screenshot_20240517_202911](https://github.com/PINTO0309/onnx2tf/assets/25856103/dbb7386f-f650-4803-873e-d1517bde445e)
After:![image](https://github.com/PINTO0309/onnx2tf/assets/25856103/caaf48b0-8385-47c0-a134-5e21d0644df0)
4. Issue number (only if there is a related issue)