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

Fix registration of custom operators #61

Closed PhilippvK closed 3 years ago

PhilippvK commented 3 years ago

While most of the tflite operators/kernels have a Register_* function returning the type TfLiteRegistration, this is not the the case for custom TFLite Micro Operators. The AddCustom() function of the MicroMutableOpsResolver still expects a pointer to a static struct.

My proposal to fix this issue:

References:

Please correct me if I am wrong.

PhilippvK commented 3 years ago

I was not sure if pull requests should target r2.4 or master. As far as I saw, r2.4 is ahead of master which does not make sense to me.

rafzi commented 3 years ago

Looks good, thanks!

The master branch is meant to track tensorflow master, but was not kept up-to-date for quite some time. You can even see that this branch fails because stuff in the CI is outdated.

So this change should go into 2.4 and master as far as I understand, but as far as I remember this was not yet changed for 2.3 right?

PhilippvK commented 3 years ago

@rafzi 7a2f20a00ad99bb52024dd0063b6e19ef800712c was first pushed to r2.3 but reverted afterwards. So yes, it seems like a TF 2.4 "thing".