PINTO0309 / onnx2tf

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
706 stars 73 forks source link

support suppressing flex ops for MatMulInteger #634

Closed DDoSolitary closed 6 months ago

DDoSolitary commented 6 months ago

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

Before: Screenshot_20240517_202911

After: image

4. Issue number (only if there is a related issue)

PINTO0309 commented 6 months ago

LGTM