TFLM: Add ONE_HOT operator and unit tests#3260
TFLM: Add ONE_HOT operator and unit tests#3260junseokShim wants to merge 13 commits intotensorflow:mainfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
@googlebot I signed it! |
26628b8 to
8ecac95
Compare
|
@junseokShim Please add a line at the end of your PR description above: |
|
@junseokShim This does not seem to be a completed PR. Please adhere to the requirements as listed in issue #3078. |
OK, I will double-check the detailed requirements and make sure they are reflected. |
| namespace tflite { | ||
| namespace ops { | ||
| namespace micro { | ||
| namespace one_hot { |
There was a problem hiding this comment.
Please flatten the namespace to just tflite.
There was a problem hiding this comment.
Okay, I'll reflect it in the next commit.
| $(TENSORFLOW_ROOT)tensorflow/lite/micro/kernels/zeros_like.cc | ||
| $(TENSORFLOW_ROOT)tensorflow/lite/micro/kernels/zeros_like.cc \ | ||
| $(TENSORFLOW_ROOT)tensorflow/lite/micro/kernels/one_hot.cc \ |
There was a problem hiding this comment.
new files should be in alphabetical order
There was a problem hiding this comment.
Okay, I'll reflect it in the next commit. too
| } | ||
| } | ||
|
|
||
| TfLiteStatus ResizeOutputTensor(TfLiteContext* context, |
There was a problem hiding this comment.
Method should have a name more representative of it's functionality.
There was a problem hiding this comment.
Okay, I'll fix the method in the next commit.
| expected_dim_i = op_context.indices->dims->data[i - 1]; | ||
| } | ||
|
|
||
| // If the size pre-allocated by the TFLM compiler (Offline Memory Planner) |
There was a problem hiding this comment.
Change Offline Memory Planner to just Memory Planner please. There are several memory planners.
There was a problem hiding this comment.
Okay, I'll change the memory planner.
| const TFLMRegistration* Register_ONE_HOT() { | ||
| static TFLMRegistration r = {}; | ||
|
|
||
| r.prepare = one_hot::Prepare; | ||
| r.invoke = one_hot::Eval; | ||
|
|
||
| return &r; | ||
| } |
There was a problem hiding this comment.
Please follow the registration implementation of all other kernels.
There was a problem hiding this comment.
Okay, I will modify the registration implementation soon.
There was a problem hiding this comment.
It's my mistake, I will remove this file at next PR.
There was a problem hiding this comment.
This file is not required. External declaration of the registration method is handled elsewhere in TFLM.
There was a problem hiding this comment.
okay. I will modify at next PR.
There was a problem hiding this comment.
Why is this file included in the PR?
There was a problem hiding this comment.
It's my mistake, I will remove this file at next PR.
This PR adds ONE_HOT operator support to TensorFlow Lite Micro.
tensorflow/lite/micro/kernels/one_hot.cctensorflow/lite/micro/kernels/one_hot.htensorflow/lite/micro/one_hot_test.ccmake -f tensorflow/lite/micro/tools/make/Makefile test_one_hot_testclang-formatandcpplint.pyon modified filesThis intends to address #3078.
bug=fixes #3078