This is a draft PR and only for discussion but not for merging as is. These are a couple of commits that show a proof of concept about how we could restructure and improve the tflite frontend. I've lightly tested these by compiling a couple of tflite models to give me some confidence that they work. If this looks reasonable I'm happy to pull things out into separate individual pull requests that could allow us to migrate to this with newer operators that get added and refactor the existing operators in a piecemeal fashion with time and availability of folks.
The first commit tries to make the tflite operator table more data driven, the observation being that the common case is that of input and output operands being subject to an equality check that we can commonize into the top level. This means we can reduce the number of individual checks in every helper function and thus making it simpler for our developers to add new operators. The second commit here shows another aspect of the tflite frontend which is the use of asserts instead of using tvm.error . If we have a set of errors that can be raised by the various frontends attached to tvm, we should use them more efficiently. Thanks, Ramana @tqchen , @anijain2305 , @FrozenGene - comments / reviews would be welcome. You can view, comment on, or merge this pull request online at: https://github.com/apache/incubator-tvm/pull/5519 -- Commit Summary -- * Proof of concept data driven tflite frontend with 2 operators. * Replace asserts in the tflite frontend with tvm.Error -- File Changes -- M python/tvm/relay/frontend/tflite.py (50) -- Patch Links -- https://github.com/apache/incubator-tvm/pull/5519.patch https://github.com/apache/incubator-tvm/pull/5519.diff -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/apache/incubator-tvm/pull/5519