@tensorflow/micro
Add the REDUCE_MiN operator to the reduce kernel.
Refactor reduce kernel to decrease number of methods in tflite namespace. Add REDUCE_MIN unit tests.
Fix unit test axis data to match tensor shape.
Make Xtensa reduce kernel use reference common code for REDUCE_MIN.
Update all op resolvers.
bug=fixes #3108
The optimized kernel selection expects a lib target to be present in third_party/xtensa/nnlib_hifi4 so provide an alias there that maps to an external repository.
Provide a build file to be used as the root of the nnlib_hifi4 repository and add to WORKSPACE. No build is done using this lib yet as there is no xtensa toolchain available in bazel just yet.
BUG=None
We need to block the following tests as they are making the CI test pipeline to be very slow.
The following tests are taking much longed in `hifi3z`.
```
feature_provider_mock_test 20.291s
feature_provider_test 20.877s
person_detection_test 21.654s
micro_features_generator_test 33.685s
simple_features_generator_test 129.49s
```
The following tests are taking much longed in `hifi5`
```
micro_features_generator_test 11.8s
simple_features_generator_test 98.411s
pytorch_to_tflite_test 173.542s
```
BUG=http://b/273538414
* Fix linter issues in a few files.
* restore file whose source of truth is the upstream TF repo.
Co-authored-by: Advait Jain <advaitjain@google.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* changed TF_LITE_MICRO_EXPECT_* macros to check for int type inputs using std::is_same and decltype.
* fix cpplint formatting
* more cpplint changes
* x86 compiler debug
* more x86 test debug
* debugging x86
* trying typeid instead of decltype/is_same combo
* trying typeid instead of decltype/is_same combo
* trying decltype/is_same again
* trying decltype/is_same again
* trying decltype/is_same again
* trying decltype/is_same again
* debug
* testing #error
* testing
* testing
* testing
* testing
* testing
* trying
* fixed cpplint error
* fixing github formatting presubmit error
* reverting changes
* isolated test to try changes to macro on
* Expect equal changes based on pr and bugonizer suggestions from Ting and Deqiang
* figuring out why changes don't compile
* syntax error
* syntax error
* debugging
* fixed control flow mistake
* Done with EQ macro time for NE
* wrote changes to NE based on EQ changes
* tested NE/EQ and then resotred file used for isolated testing back to what it was in main branch
* formating change for git style check presubmit
* formating change for git style check presubmit
* formating change for git style check presubmit
* refactored the parts of x86 and kernal test that weren't compatible with change. Replaced with EXPECT_NEAR equivalents using a very small epsilon
* git presubmit style formatting changes
* git presubmit style formatting changes
* git presubmit style formatting changes
* git presubmit style formatting changes
* bazel test fixes for presubmit
* change include iostream to type_traits for is_same
* changed .0.0000000001f to 1e-5f in test for to make it easier to read
* rolling back changes to all test files
* changed to EXPECT_EQ and EXPECT_NE to use std::numeric_limits<decltype(delta)>::epsilon()
* control flow fix
* control flow fix
* control flow fix
* debugging
* debugging
* debugging
* debugging
* debugging
* debugging compile error
* reverting EXPECT_NE to prev change and testing EQ seperately
* presubmit github formatting change
* reverting example to test to main
* git fromat fix for presubmit
* git fromat fix for presubmit
* changing is_same to is_floating_point to make code easier to read
* changing is_same to is_floating_point to make code easier to read
* debugging nullptr error with EXPECT_NE
* debugging nullptr error with EXPECT_NE
* debugging nullptr error with EXPECT_NE
* debugging nullptr error with EXPECT_NE
* debugging nullptr error with EXPECT_NE
* debugging nullptr error with EXPECT_NE
* debugging nullptr error with EXPECT_NE
* debugging nullptr error with EXPECT_NE
* debugging nullptr error with EXPECT_NE
* not using NEAR like implementation for NE due to issues with Null_ptrs used in NE test. But honestly no current test use EXPECT_NE with floats or doubles. But in case they do added error message suggestion users use EXPECT_NEAR for Float double not equals testing
* not using NEAR like implementation for NE due to issues with Null_ptrs used in NE test. But honestly no current test use EXPECT_NE with floats or doubles. But in case they do added error message suggestion users use EXPECT_NEAR for Float double not equals testing
* logic error fix for if statement
* returning test file used to test macro changes back to orginal
* changed based on cr suggestions by deqiang
* git style changes presubmit changes
* git style changes presubmit changes
* git style changes presubmit changes
* git style changes presubmit changes
* git style changes presubmit changes
* git style changes presubmit changes
* git style changes presubmit changes
* git style changes presubmit changes
* typo in a string
* fixed all test that used nullptr's with EXPECT_NE to use EXPECT macro instead
* github style presubmit fixes
* github style presubmit fixes
* github style presubmit fixes
* fixing compiler errors non x86 and accidental change to a test file
* channing EXPECT_NE in helloworld that was reverted
* fixing presubmit
* fixing style presubmit
* fixing presubmit
* changing TF_LITE_MICRO_EXPECT to be consistent
* accidentally changed a variable name
* changing all EXPECT to EXPECT(PTR != nullptr)
* irrevlavent EXPECT macro usage
* changing one ptr != nullptr to expect(ptr)
* style fixes for presubmit
* style fixes for presubmit
* fixing file from merge conflict
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Cadence: Pytorch(mobilenet_v2) to tflite quantized
Describved two methos to convert from pytorch to tflite
1. Using TinyNN tool
2. Using pytorch to onnx to tf(saved_model) to
tflite(float32)/tflite(int8 quantized)
* Update pytorch_to_tflite_test.cc
* Update pytorch_images_dog_jpg.cc
* Remove unnecessary space
* Change HIFI4 and HIFI4_INTERNAL #ifndef locations and apply clang-format
Co-authored-by: Ting Yan <94130036+tingyan19@users.noreply.github.com>
* Handle nullptr bias in fully_connected op
* Validate tensor index in GetEvalInput.
* Check for nullptr bias tensor in fully connected kernel.
Change-Id: I5d52cd0ddc40399e3ddd1b37010e9db1b2ef1876
* Update fully_connected kernel related to null bias
Adds null bias unit tests for fully connected.
Undoes changes (from first commit of the PR, this is the second commit)
in tensorflow/lite/kernels/kernel_util.* (to be done in another PR).
* Add ValidateTensorIndexing to lite/kernel/micro/kernel_util
* Fix formatting error in Bazel Build file
* small style-related changes.
* Fix the Xtensa kernels as well.
* Patch nnlib (hifi4 and hifi5) to allow null bias for fully connected.
This is groundwork towards merging https://github.com/tensorflow/tflite-micro/pull/590
BUG=#589 and http://b/205306469
* format the code.
* updates since we no longer depend on lite/kernel_utils.h
Co-authored-by: Advait Jain <advaitjain@users.noreply.github.com>
Co-authored-by: Advait Jain <advaitjain@google.com>
The lstm kernel is only available when `OPTIMIZED_KERNEL_DIR=xtensa`.
https://github.com/tensorflow/tflite-micro/pull/643 fixed part of the build, but the xtensa lstm example was still failing with the reference kernels.
Tested that the following command passes with this change, and fails without it:
```
make -f tensorflow/lite/micro/tools/make/Makefile TARGET=xtensa TARGET_ARCH=hifi4 XTENSA_CORE=F1_190305_swupgrade build -j8
```
BUG=http://b/204814982
* lstm:xtensa:update colab link and model.zip
BUG=cleanup
* small updates to the documentation.
Co-authored-by: Advait Jain <advaitjain@google.com>
Co-authored-by: Advait Jain <advaitjain@users.noreply.github.com>
* lstm:training micro speech lstm model
Signed-off-by: Niranjan Yadla <nyadla@cadence.com>
* Updated Makefile.inc
* Removed files that should not be needed
* The model file is directly committed into the repository (and converted
to model.cc and model.h during the Makefile build)
* So, we do not need model.zip in the train folder and we do not need
model.cc and model.h either.
* We do need bazel support for this example (removed the BUILD file).
Also, chmod -x for some of the files.
* Remove unnecessary maxdepth parameter.
* ADD LICENSE file
Co-authored-by: Advait Jain <advaitjain@google.com>