cpetig / tflite_micro_compiler

generate tflite micro code which bypasses the interpreter (directly calls into kernels)
Apache License 2.0
77 stars 26 forks source link

TFL Custom Ops #15

Closed arashb closed 4 years ago

arashb commented 4 years ago

Hi,

Thanks for creating this tool. This is a great idea and makes a lot of sense for embedded devices. I was wondering whether there is a plan to support TFL custom ops? I think in order to support custom ops, I need to pass a custom MicroOpResolver instance to the Compiler's class constructor and add a writeCustom method to the CodeWriter class? Other than these two changes, is there any other modification required?

Thanks

cpetig commented 4 years ago

Hi Arash, I made a proposal for a generic implementation in #16 which could get part of our tree soon (shouldn't be that difficult to implement as you might be willing to test it thoroughly 😉), do you agree to this proposal? Best regards, Christof

cpetig commented 4 years ago

PS: You won't be the only one to need it, I just didn't get to this point yet.

cpetig commented 4 years ago

Hi Arash, please take a look at my implementation in the devel branch. There is an example in examples/custom which should give you a good starting point.

arashb commented 4 years ago

Thanks for the quick fix. I will take a look ASAP.

cpetig commented 4 years ago

Oh, please take a look at the newest commit to the devel branch, I fixed several dumb mistakes in the past minutes.