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
Add an InitializeTarget function that can be specialized for a given target. #47077
Add an InitializeTarget function that can be specialized for a given target. #47077
Conversation
Thanks for contributing to TensorFlow Lite Micro. To keep this process moving along, we'd like to make sure that you have completed the items on this list:
We would like to have a discussion on the Github issue first to determine the best path forward, and then proceed to the PR review. |
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.
Looking good! Just a minor comment
tensorflow/lite/micro/system_setup.h
Outdated
namespace tflite { | ||
|
||
// This should called during initialization of TFLM binaries and tests. It can | ||
// be specialized if there us a need for custom target-specific intialization. |
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.
nitpick: typo
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.
fixed.
57a6974
to
dcd8bd6
Compare
dcd8bd6
to
99b240e
Compare
99b240e
to
f01253a
Compare
@njeffrie: after our dicussion, I decided to go one step further and not add calls to InitializeTarget from DebugLog for the Arduino and SparkfunEdge. Instead, I added a call to InitializeTarget from all of our examples. I like this approach more because it gives full control of the initialization to the application rather than having some mysterious init calls hidden away in DebugLog. The down-side is that I might have broken some examples on Arduino/SparkfunEdge because the change is not tested on actual hardware. |
f01253a
to
a8cc378
Compare
…target. This will allow the unit tests to be run on additional targets that need some addiitonal initialization (for example cornstone_300 from tensorflow#46830). This particular change is broken out from the Cornstone PR tensorflow#46830 to be able to have smaller more reviewable PRs. In the past, we have added state to the DebugLog() and GetCurrentTimeTicks() functions as a way to avoid having an InitializeTarget function. With this change, we are deciding to go with an explicit intitialization step instead. This change has added calls to tflite::InitializeTarget to the tests, benchmarks, and examples and converted the Arduino and SparkfunEdge to make use of this explicit initialization. The changes for the Arduino and SparkfunEdge have not been tested on actual hardware. Progress towards tensorflow#46829
a8cc378
to
81d33f1
Compare
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.
We will have to update internal examples as well once this has landed.
This will allow the unit tests to be run on additional targets that need some addiitonal initialization (for example corstone_300 from #46830).
This particular change is broken out from the Corstone PR #46830 to be able to have smaller more reviewable PRs.
In the past, we have added state to the DebugLog() and GetCurrentTimeTicks() functions as a way to avoid having an InitializeTarget function. With this change, we are deciding to go with an explicit intitialization step instead.
This change has added calls to tflite::InitializeTarget to the tests, benchmarks, and examples and converted the Arduino and SparkfunEdge to make use of this explicit initialization.
The changes for the Arduino and SparkfunEdge have not been tested on actual hardware.
Progress towards #46829
Fixes http://b/150808076