-
Notifications
You must be signed in to change notification settings - Fork 975
Add RFFT kernel to MicroMutableOpResolver. #3265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This change includes the RFFT kernel header, making the RFFT operation specialized for different types (int16 etc.) available for use in TFLite Micro models via the MicroMutableOpResolver.
|
@shlmregev @veblush I am confused by this PR change. Could not the application developer have included |
The visibility for register_signal_ops is limited to "//tensorflow/lite/micro" and that's the only rule that exposes this header. |
| #include <cstdio> | ||
| #include <cstring> | ||
|
|
||
| #include "signal/micro/kernels/rfft.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the standard approach here is to add the register functions to
tflite-micro/tensorflow/lite/micro/kernels/micro_ops.h
Lines 145 to 158 in 9cbf6e0
| namespace tflm_signal { | |
| TFLMRegistration* Register_DELAY(); | |
| TFLMRegistration* Register_FFT_AUTO_SCALE(); | |
| TFLMRegistration* Register_FILTER_BANK(); | |
| TFLMRegistration* Register_FILTER_BANK_LOG(); | |
| TFLMRegistration* Register_FILTER_BANK_SPECTRAL_SUBTRACTION(); | |
| TFLMRegistration* Register_FILTER_BANK_SQUARE_ROOT(); | |
| TFLMRegistration* Register_ENERGY(); | |
| TFLMRegistration* Register_FRAMER(); | |
| TFLMRegistration* Register_OVERLAP_ADD(); | |
| TFLMRegistration* Register_PCAN(); | |
| TFLMRegistration* Register_STACKER(); | |
| TFLMRegistration* Register_WINDOW(); | |
| } // namespace tflm_signal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason why I need to include this file, is so that I can do this:
AddRfft(::tflite::tflm_signal::Register_RFFT_INT16());
Should I add ::tflite::tflm_signal::Register_RFFT_INT16() to micro_ops.h?
micro_ops.h doesn't define any other Register_ function for specialized types. And looking at tensorflow/lite/micro/micro_mutable_op_resolver.h, there are multiple kernel headers included there, presumably for the same purpose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shlmregev @veblush Ah, I understand now. This is how CONV_2D, FULLY_CONNECTED, MUL, etc. expose their additional registrations as well. So micro_mutable_op_resolver.h is the right place to put the include. I'm thinking that signal/micro/kernels/irfft.h should also be included here, as it also has multiple registrations.
This change includes the RFFT kernel header, making the RFFT operation specialized for different types (int16 etc.) available for use in TFLite Micro models via the MicroMutableOpResolver.
BUG=315941833