├── python ├── BUILD ├── tflite_micro │ ├── _version.py.in │ ├── signal │ │ ├── __init__.py │ │ └── ops │ │ │ ├── __init__.py │ │ │ └── testdata │ │ │ ├── filter_bank_accumulation_16k.txt │ │ │ ├── filter_bank_accumulation_44k.txt │ │ │ ├── filter_bank_accumulation_8k.txt │ │ │ └── BUILD │ ├── sine_float.tflite │ ├── README.pypi.md.in │ ├── pypi_build.dockerfile │ └── python_utils.h └── tests │ ├── BUILD │ └── cc_deps_link_test.cc ├── .bazelversion ├── tensorflow ├── lite │ ├── micro │ │ ├── python │ │ │ ├── BUILD │ │ │ ├── interpreter │ │ │ │ ├── BUILD │ │ │ │ └── src │ │ │ │ │ ├── BUILD │ │ │ │ │ ├── runtime.py │ │ │ │ │ ├── tflm_runtime.py │ │ │ │ │ └── python_ops_resolver.h │ │ │ └── tflite_size │ │ │ │ ├── sample_output.png │ │ │ │ ├── tests │ │ │ │ ├── simple_add_model.tflite │ │ │ │ └── BUILD │ │ │ │ └── README.md │ │ ├── tools │ │ │ ├── make │ │ │ │ ├── additional_tests.inc │ │ │ │ ├── ext_libs │ │ │ │ │ ├── ceva.inc │ │ │ │ │ ├── vexriscv.inc │ │ │ │ │ ├── ndsplib-hifi3.patch │ │ │ │ │ ├── hexagon.inc │ │ │ │ │ └── xi_tflmlib_vision_p6.patch │ │ │ │ ├── .gitignore │ │ │ │ └── additional_kernels.inc │ │ │ ├── ci_build │ │ │ │ ├── binary_size_history │ │ │ │ │ └── binary_size.json │ │ │ │ ├── binary_size_test │ │ │ │ │ └── Makefile.inc │ │ │ │ ├── test_bazel.sh │ │ │ │ ├── test_bazel_with_compression.sh │ │ │ │ ├── test_bazel_asan.sh │ │ │ │ ├── test_bazel_msan.sh │ │ │ │ ├── test_bazel_with_compression_asan.sh │ │ │ │ └── test_bazel_with_compression_msan.sh │ │ │ ├── github │ │ │ │ └── arm │ │ │ │ │ └── vcpkg-configuration.json │ │ │ ├── Makefile.inc │ │ │ ├── project_generation │ │ │ │ └── BUILD.testing │ │ │ ├── dev_setup │ │ │ │ └── pre-push.tflm │ │ │ └── benchmarking │ │ │ │ └── show_meta_data.h │ │ ├── integration_tests │ │ │ ├── seanet │ │ │ │ ├── transpose_conv │ │ │ │ │ ├── transpose_conv0_input0_int32.csv │ │ │ │ │ ├── transpose_conv1_input0_int32.csv │ │ │ │ │ ├── transpose_conv2_input0_int32.csv │ │ │ │ │ ├── transpose_conv3_input0_int32.csv │ │ │ │ │ ├── transpose_conv4_input0_int32.csv │ │ │ │ │ ├── transpose_conv0.tflite │ │ │ │ │ ├── transpose_conv1.tflite │ │ │ │ │ ├── transpose_conv2.tflite │ │ │ │ │ ├── transpose_conv3.tflite │ │ │ │ │ └── transpose_conv4.tflite │ │ │ │ ├── sub │ │ │ │ │ ├── sub4_input1_int16.csv │ │ │ │ │ ├── sub3_input1_int16.csv │ │ │ │ │ ├── sub0.tflite │ │ │ │ │ ├── sub1.tflite │ │ │ │ │ ├── sub2.tflite │ │ │ │ │ ├── sub3.tflite │ │ │ │ │ ├── sub4.tflite │ │ │ │ │ ├── sub1_input1_int16.csv │ │ │ │ │ ├── sub2_input1_int16.csv │ │ │ │ │ └── sub0_input1_int16.csv │ │ │ │ ├── add │ │ │ │ │ ├── add0.tflite │ │ │ │ │ ├── add1.tflite │ │ │ │ │ ├── add2.tflite │ │ │ │ │ ├── add3.tflite │ │ │ │ │ ├── add4.tflite │ │ │ │ │ ├── add5.tflite │ │ │ │ │ ├── add6.tflite │ │ │ │ │ ├── add7.tflite │ │ │ │ │ ├── add8.tflite │ │ │ │ │ ├── add9.tflite │ │ │ │ │ ├── add10.tflite │ │ │ │ │ ├── add11.tflite │ │ │ │ │ ├── add12.tflite │ │ │ │ │ ├── add13.tflite │ │ │ │ │ ├── add14.tflite │ │ │ │ │ ├── add15.tflite │ │ │ │ │ └── add16.tflite │ │ │ │ ├── pad │ │ │ │ │ ├── pad0.tflite │ │ │ │ │ ├── pad1.tflite │ │ │ │ │ ├── pad2.tflite │ │ │ │ │ ├── pad3.tflite │ │ │ │ │ ├── pad4.tflite │ │ │ │ │ ├── pad5.tflite │ │ │ │ │ ├── pad6.tflite │ │ │ │ │ ├── pad7.tflite │ │ │ │ │ ├── pad8.tflite │ │ │ │ │ ├── pad9.tflite │ │ │ │ │ ├── pad10.tflite │ │ │ │ │ ├── pad11.tflite │ │ │ │ │ ├── pad12.tflite │ │ │ │ │ ├── pad13.tflite │ │ │ │ │ ├── pad14.tflite │ │ │ │ │ ├── pad15.tflite │ │ │ │ │ ├── pad16.tflite │ │ │ │ │ ├── pad17.tflite │ │ │ │ │ ├── pad18.tflite │ │ │ │ │ ├── pad12_input0_int16.csv │ │ │ │ │ └── pad12_golden_int16.csv │ │ │ │ ├── conv │ │ │ │ │ ├── conv0.tflite │ │ │ │ │ ├── conv1.tflite │ │ │ │ │ ├── conv2.tflite │ │ │ │ │ ├── conv3.tflite │ │ │ │ │ ├── conv4.tflite │ │ │ │ │ ├── conv5.tflite │ │ │ │ │ ├── conv6.tflite │ │ │ │ │ ├── conv7.tflite │ │ │ │ │ ├── conv8.tflite │ │ │ │ │ ├── conv9.tflite │ │ │ │ │ ├── conv10.tflite │ │ │ │ │ ├── conv11.tflite │ │ │ │ │ ├── conv12.tflite │ │ │ │ │ ├── conv13.tflite │ │ │ │ │ ├── conv14.tflite │ │ │ │ │ ├── conv15.tflite │ │ │ │ │ ├── conv16.tflite │ │ │ │ │ ├── conv17.tflite │ │ │ │ │ ├── conv18.tflite │ │ │ │ │ ├── conv19.tflite │ │ │ │ │ ├── conv20.tflite │ │ │ │ │ ├── conv21.tflite │ │ │ │ │ └── conv11_golden_int16.csv │ │ │ │ ├── quantize │ │ │ │ │ ├── quantize0.tflite │ │ │ │ │ └── quantize1.tflite │ │ │ │ ├── leaky_relu │ │ │ │ │ ├── leaky_relu0.tflite │ │ │ │ │ ├── leaky_relu1.tflite │ │ │ │ │ ├── leaky_relu10.tflite │ │ │ │ │ ├── leaky_relu11.tflite │ │ │ │ │ ├── leaky_relu12.tflite │ │ │ │ │ ├── leaky_relu13.tflite │ │ │ │ │ ├── leaky_relu14.tflite │ │ │ │ │ ├── leaky_relu15.tflite │ │ │ │ │ ├── leaky_relu16.tflite │ │ │ │ │ ├── leaky_relu17.tflite │ │ │ │ │ ├── leaky_relu18.tflite │ │ │ │ │ ├── leaky_relu19.tflite │ │ │ │ │ ├── leaky_relu2.tflite │ │ │ │ │ ├── leaky_relu20.tflite │ │ │ │ │ ├── leaky_relu21.tflite │ │ │ │ │ ├── leaky_relu22.tflite │ │ │ │ │ ├── leaky_relu3.tflite │ │ │ │ │ ├── leaky_relu4.tflite │ │ │ │ │ ├── leaky_relu5.tflite │ │ │ │ │ ├── leaky_relu6.tflite │ │ │ │ │ ├── leaky_relu7.tflite │ │ │ │ │ ├── leaky_relu8.tflite │ │ │ │ │ ├── leaky_relu9.tflite │ │ │ │ │ ├── leaky_relu11_golden_int16.csv │ │ │ │ │ └── leaky_relu11_input0_int16.csv │ │ │ │ └── strided_slice │ │ │ │ │ ├── strided_slice0.tflite │ │ │ │ │ ├── strided_slice1.tflite │ │ │ │ │ ├── strided_slice2.tflite │ │ │ │ │ ├── strided_slice3.tflite │ │ │ │ │ ├── strided_slice4.tflite │ │ │ │ │ ├── strided_slice5.tflite │ │ │ │ │ ├── strided_slice6.tflite │ │ │ │ │ ├── strided_slice7.tflite │ │ │ │ │ ├── strided_slice8.tflite │ │ │ │ │ ├── strided_slice9.tflite │ │ │ │ │ ├── strided_slice10.tflite │ │ │ │ │ ├── strided_slice11.tflite │ │ │ │ │ ├── strided_slice12.tflite │ │ │ │ │ ├── strided_slice13.tflite │ │ │ │ │ ├── strided_slice14.tflite │ │ │ │ │ ├── strided_slice15.tflite │ │ │ │ │ ├── strided_slice16.tflite │ │ │ │ │ ├── strided_slice17.tflite │ │ │ │ │ ├── strided_slice18.tflite │ │ │ │ │ ├── strided_slice19.tflite │ │ │ │ │ ├── strided_slice20.tflite │ │ │ │ │ ├── strided_slice21.tflite │ │ │ │ │ ├── strided_slice22.tflite │ │ │ │ │ ├── strided_slice23.tflite │ │ │ │ │ ├── strided_slice24.tflite │ │ │ │ │ ├── strided_slice25.tflite │ │ │ │ │ ├── strided_slice26.tflite │ │ │ │ │ ├── strided_slice27.tflite │ │ │ │ │ ├── strided_slice28.tflite │ │ │ │ │ ├── strided_slice29.tflite │ │ │ │ │ ├── strided_slice30.tflite │ │ │ │ │ ├── strided_slice31.tflite │ │ │ │ │ ├── strided_slice32.tflite │ │ │ │ │ └── strided_slice33.tflite │ │ │ └── BUILD │ │ ├── examples │ │ │ ├── network_tester │ │ │ │ └── .gitignore │ │ │ ├── mnist_lstm │ │ │ │ ├── samples │ │ │ │ │ ├── resized9.png │ │ │ │ │ ├── sample0.png │ │ │ │ │ ├── sample1.png │ │ │ │ │ ├── sample2.png │ │ │ │ │ ├── sample3.png │ │ │ │ │ ├── sample4.png │ │ │ │ │ ├── sample5.png │ │ │ │ │ ├── sample6.png │ │ │ │ │ ├── sample7.png │ │ │ │ │ ├── sample8.png │ │ │ │ │ └── sample9.png │ │ │ │ ├── trained_lstm.tflite │ │ │ │ ├── trained_lstm_int8.tflite │ │ │ │ └── BUILD │ │ │ ├── micro_speech │ │ │ │ ├── testdata │ │ │ │ │ ├── no_30ms.wav │ │ │ │ │ ├── no_1000ms.wav │ │ │ │ │ ├── yes_1000ms.wav │ │ │ │ │ ├── yes_30ms.wav │ │ │ │ │ ├── noise_1000ms.wav │ │ │ │ │ └── silence_1000ms.wav │ │ │ │ ├── images │ │ │ │ │ ├── micro_speech_quantized.png │ │ │ │ │ └── audio_preprocessor_int8.png │ │ │ │ ├── models │ │ │ │ │ ├── audio_preprocessor_float.tflite │ │ │ │ │ ├── audio_preprocessor_int8.tflite │ │ │ │ │ └── micro_speech_quantized.tflite │ │ │ │ └── train_speech_model.ipynb │ │ │ ├── dtln │ │ │ │ ├── dtln_noise_suppression.tflite │ │ │ │ └── dtln_inout_data.h │ │ │ ├── person_detection │ │ │ │ ├── testdata │ │ │ │ │ ├── person.bmp │ │ │ │ │ └── no_person.bmp │ │ │ │ ├── model_settings.cc │ │ │ │ ├── utils │ │ │ │ │ └── BUILD │ │ │ │ ├── image_provider.cc │ │ │ │ └── main.cc │ │ │ ├── hello_world │ │ │ │ ├── images │ │ │ │ │ ├── hello_world_tflite.png │ │ │ │ │ └── hello_world_tflm.png │ │ │ │ ├── models │ │ │ │ │ ├── hello_world_float.tflite │ │ │ │ │ ├── hello_world_int8.tflite │ │ │ │ │ └── BUILD │ │ │ │ └── quantization │ │ │ │ │ └── BUILD │ │ │ ├── memory_footprint │ │ │ │ ├── models │ │ │ │ │ └── simple_add_model.tflite │ │ │ │ ├── images │ │ │ │ │ └── tflm_code_size_category.png │ │ │ │ └── baseline_memory_footprint.cc │ │ │ └── recipes │ │ │ │ └── BUILD │ │ ├── testing │ │ │ ├── bluepill.resource.txt │ │ │ ├── robot.resource.txt │ │ │ ├── bluepill_nontest.resc │ │ │ ├── Dockerfile.riscv │ │ │ ├── test_conv_model.h │ │ │ └── bluepill.resc │ │ ├── models │ │ │ ├── person_detect.tflite │ │ │ ├── keyword_scrambled.tflite │ │ │ ├── person_detect_vela.tflite │ │ │ └── keyword_scrambled_8bit.tflite │ │ ├── docs │ │ │ └── images │ │ │ │ ├── tflm_continuous_integration_1.png │ │ │ │ └── preallocated_tensors │ │ │ │ ├── preallocated_tensors_bg_1.png │ │ │ │ ├── preallocated_tensors_bg_2.png │ │ │ │ └── preallocated_tensors_impl1.png │ │ ├── kernels │ │ │ ├── README.md │ │ │ ├── test_data_generation │ │ │ │ ├── README.md │ │ │ │ └── BUILD │ │ │ ├── ethosu.cc │ │ │ ├── circular_buffer_flexbuffers_generated_data.h │ │ │ ├── reshape.h │ │ │ ├── ceva │ │ │ │ ├── ceva_common.h │ │ │ │ └── ceva_common.cc │ │ │ ├── ethosu.h │ │ │ ├── detection_postprocess_flexbuffers_generated_data.h │ │ │ └── hard_swish.h │ │ ├── ceva │ │ │ ├── micro_time.cc │ │ │ └── system_setup.cc │ │ ├── compression │ │ │ ├── view_test.py │ │ │ ├── __init__.py │ │ │ └── metadata_saved_update.sh │ │ ├── arc_custom │ │ │ └── system_setup.cc │ │ ├── system_setup.cc │ │ ├── cortex_m_corstone_300 │ │ │ └── micro_time.cc │ │ ├── hexagon │ │ │ └── micro_time.cc │ │ ├── tflite_bridge │ │ │ └── BUILD │ │ ├── micro_arena_constants.h │ │ └── system_setup.h │ ├── core │ │ ├── BUILD │ │ ├── c │ │ │ └── BUILD │ │ └── api │ │ │ ├── error_reporter.h │ │ │ └── tensor_utils.h │ ├── experimental │ │ └── microfrontend │ │ │ ├── README.md │ │ │ └── lib │ │ │ ├── kiss_fft_int16.cc │ │ │ ├── log_scale_io.c │ │ │ └── log_scale_util.c │ ├── build_def.bzl │ ├── python │ │ └── BUILD │ ├── c │ │ ├── BUILD │ │ ├── builtin_op_data.h │ │ └── c_api_types.h │ ├── BUILD │ ├── kernels │ │ └── internal │ │ │ ├── reference │ │ │ └── integer_ops │ │ │ │ └── mean.h │ │ │ ├── runtime_shape.cc │ │ │ └── optimized │ │ │ └── neon_check.h │ ├── schema │ │ ├── schema_utils.h │ │ └── BUILD │ └── builtin_op_data.h ├── BUILD ├── compiler │ └── mlir │ │ └── lite │ │ ├── kernels │ │ └── internal │ │ │ ├── BUILD │ │ │ └── compatibility_macros.h │ │ ├── core │ │ ├── api │ │ │ └── BUILD │ │ └── c │ │ │ └── BUILD │ │ └── schema │ │ ├── BUILD │ │ └── schema_generated.h └── extra_rules.bzl ├── .style.yapf ├── CODEOWNERS ├── SECURITY.md ├── codegen ├── README.md ├── examples │ └── hello_world │ │ ├── BUILD │ │ ├── README.md │ │ └── hello_world.cc ├── runtime │ └── BUILD └── operators │ └── BUILD ├── third_party ├── flatbuffers │ ├── BUILD │ ├── workspace.bzl │ └── BUILD.system ├── kissfft │ ├── BUILD │ ├── BUILD.bazel │ └── workspace.bzl ├── ruy │ ├── BUILD │ └── workspace.bzl └── xtensa │ ├── examples │ ├── micro_speech_lstm │ │ ├── images │ │ │ ├── lstm_model.png │ │ │ └── spectrogram.png │ │ └── micro_speech_lstm.tflite │ └── pytorch_to_tflite │ │ ├── images │ │ └── qat_model.png │ │ ├── mobilenet_v2_quantized_1x3x224x224.tflite │ │ ├── README.md │ │ ├── pytorch_op_resolver.h │ │ └── Makefile.inc │ └── nnlib_hifi4 │ ├── BUILD │ └── nnlib_hifi4.BUILD ├── .clang-format ├── data └── continuous_builds │ ├── size_profiling │ └── linux_x86_64_release │ │ ├── keyword_benchmark.png │ │ ├── baseline_memory_footprint.png │ │ └── interpreter_memory_footprint.png │ └── README.md ├── .github ├── ci-error-template.md ├── scheduled-error-template.md ├── stale.yml └── workflows │ ├── run_ci.yml │ ├── stale_handler.yml │ ├── riscv_postmerge.yml │ └── run_hexagon.yml ├── .gitignore ├── signal ├── micro │ └── kernels │ │ ├── pcan_flexbuffers_generated_data.cc │ │ ├── pcan_flexbuffers_generated_data.h │ │ ├── fft_auto_scale_kernel.h │ │ ├── filter_bank_square_root.h │ │ ├── delay_flexbuffers_generated_data.h │ │ ├── rfft.h │ │ ├── irfft.h │ │ └── framer_flexbuffers_generated_data.h ├── testdata │ └── BUILD └── src │ ├── kiss_fft_wrappers │ ├── BUILD │ ├── kiss_fft_float.cc │ ├── kiss_fft_int16.cc │ └── kiss_fft_int32.cc │ ├── complex.h │ ├── log.h │ ├── square_root.h │ ├── max_abs.h │ ├── msb.h │ └── filter_bank_square_root.cc ├── AUTHORS ├── tools └── BUILD ├── ci ├── install_cores_xplorer_11.sh ├── install_cores_xplorer_solo.sh ├── install_bazelisk.sh ├── install_cores_xplorer_13.sh └── install_buildifier.sh ├── BUILD └── .editorconfig /python/BUILD: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.bazelversion: -------------------------------------------------------------------------------- 1 | 7.0.0 2 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/python/BUILD: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tensorflow/BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/python/interpreter/BUILD: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/tools/make/additional_tests.inc: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/tools/make/ext_libs/ceva.inc: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/tools/make/ext_libs/vexriscv.inc: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/tools/make/.gitignore: -------------------------------------------------------------------------------- 1 | downloads 2 | 3 | -------------------------------------------------------------------------------- /.style.yapf: -------------------------------------------------------------------------------- 1 | [style] 2 | based_on_style = pep8 3 | indent_width = 2 4 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @tensorflow/micro 2 | 3 | /.github/ @veblush 4 | /ci/ @veblush 5 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | Please refer to: https://github.com/tensorflow/tensorflow/blob/master/SECURITY.md 2 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/transpose_conv/transpose_conv0_input0_int32.csv: -------------------------------------------------------------------------------- 1 | 1,3,12,64 2 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/transpose_conv/transpose_conv1_input0_int32.csv: -------------------------------------------------------------------------------- 1 | 1,3,22,32 2 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/transpose_conv/transpose_conv2_input0_int32.csv: -------------------------------------------------------------------------------- 1 | 1,3,42,32 2 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/transpose_conv/transpose_conv3_input0_int32.csv: -------------------------------------------------------------------------------- 1 | 1,4,82,16 2 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/transpose_conv/transpose_conv4_input0_int32.csv: -------------------------------------------------------------------------------- 1 | 1,4,162,8 2 | -------------------------------------------------------------------------------- /codegen/README.md: -------------------------------------------------------------------------------- 1 | # TFLM Code Generator 2 | 3 | This is a work in progress experiment. It is not ready for use. 4 | -------------------------------------------------------------------------------- /third_party/flatbuffers/BUILD: -------------------------------------------------------------------------------- 1 | # This empty BUILD file is required to make Bazel treat this directory as a package. 2 | -------------------------------------------------------------------------------- /third_party/kissfft/BUILD: -------------------------------------------------------------------------------- 1 | # This empty BUILD file is required to make Bazel treat this directory as a package. 2 | -------------------------------------------------------------------------------- /python/tflite_micro/_version.py.in: -------------------------------------------------------------------------------- 1 | __version__ = "{BUILD_EMBED_LABEL}.dev{STABLE_GIT_COMMIT_TIME}-g{STABLE_GIT_HASH}" 2 | -------------------------------------------------------------------------------- /python/tflite_micro/signal/__init__.py: -------------------------------------------------------------------------------- 1 | # Empty file required by setuptools.find_packages to recognize this as a package 2 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/network_tester/.gitignore: -------------------------------------------------------------------------------- 1 | input_data.h 2 | expected_output_data.h 3 | network_model.h 4 | -------------------------------------------------------------------------------- /python/tflite_micro/signal/ops/__init__.py: -------------------------------------------------------------------------------- 1 | # Empty file required by setuptools.find_packages to recognize this as a package 2 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/sub/sub4_input1_int16.csv: -------------------------------------------------------------------------------- 1 | 13472,-12125,-16652,6799,1824,14459,18182,10614 2 | -------------------------------------------------------------------------------- /python/tflite_micro/sine_float.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/python/tflite_micro/sine_float.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/testing/bluepill.resource.txt: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | ${UART} sysbus.cpu.uartSemihosting 3 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/tools/ci_build/binary_size_history/binary_size.json: -------------------------------------------------------------------------------- 1 | {"text": "64680", "data": "41304", "bss": "24888", "dec": "130872"} 2 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | # Run manually to reformat a file: 2 | # clang-format -i --style=file 3 | BasedOnStyle: Google 4 | DerivePointerAlignment: false 5 | -------------------------------------------------------------------------------- /third_party/ruy/BUILD: -------------------------------------------------------------------------------- 1 | # Ruy is not BLAS 2 | 3 | package( 4 | default_visibility = ["//visibility:public"], 5 | licenses = ["notice"], 6 | ) 7 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/models/person_detect.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/models/person_detect.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/models/keyword_scrambled.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/models/keyword_scrambled.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/models/person_detect_vela.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/models/person_detect_vela.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/sub/sub3_input1_int16.csv: -------------------------------------------------------------------------------- 1 | 12932,14113,1840,17144,-15066,11889,-15224,29573,-28157,13432,22163,-80,20229,27478,13216,1034 2 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/models/keyword_scrambled_8bit.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/models/keyword_scrambled_8bit.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/python/tflite_size/sample_output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/python/tflite_size/sample_output.png -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/mnist_lstm/samples/resized9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/mnist_lstm/samples/resized9.png -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/mnist_lstm/samples/sample0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/mnist_lstm/samples/sample0.png -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/mnist_lstm/samples/sample1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/mnist_lstm/samples/sample1.png -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/mnist_lstm/samples/sample2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/mnist_lstm/samples/sample2.png -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/mnist_lstm/samples/sample3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/mnist_lstm/samples/sample3.png -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/mnist_lstm/samples/sample4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/mnist_lstm/samples/sample4.png -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/mnist_lstm/samples/sample5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/mnist_lstm/samples/sample5.png -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/mnist_lstm/samples/sample6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/mnist_lstm/samples/sample6.png -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/mnist_lstm/samples/sample7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/mnist_lstm/samples/sample7.png -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/mnist_lstm/samples/sample8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/mnist_lstm/samples/sample8.png -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/mnist_lstm/samples/sample9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/mnist_lstm/samples/sample9.png -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/mnist_lstm/trained_lstm.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/mnist_lstm/trained_lstm.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/add/add0.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/add/add0.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/add/add1.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/add/add1.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/add/add2.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/add/add2.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/add/add3.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/add/add3.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/add/add4.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/add/add4.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/add/add5.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/add/add5.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/add/add6.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/add/add6.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/add/add7.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/add/add7.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/add/add8.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/add/add8.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/add/add9.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/add/add9.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/pad/pad0.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/pad/pad0.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/pad/pad1.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/pad/pad1.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/pad/pad2.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/pad/pad2.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/pad/pad3.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/pad/pad3.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/pad/pad4.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/pad/pad4.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/pad/pad5.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/pad/pad5.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/pad/pad6.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/pad/pad6.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/pad/pad7.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/pad/pad7.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/pad/pad8.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/pad/pad8.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/pad/pad9.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/pad/pad9.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/sub/sub0.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/sub/sub0.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/sub/sub1.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/sub/sub1.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/sub/sub2.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/sub/sub2.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/sub/sub3.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/sub/sub3.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/sub/sub4.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/sub/sub4.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/tools/make/ext_libs/ndsplib-hifi3.patch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/tools/make/ext_libs/ndsplib-hifi3.patch -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/micro_speech/testdata/no_30ms.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/micro_speech/testdata/no_30ms.wav -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/add/add10.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/add/add10.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/add/add11.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/add/add11.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/add/add12.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/add/add12.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/add/add13.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/add/add13.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/add/add14.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/add/add14.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/add/add15.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/add/add15.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/add/add16.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/add/add16.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/conv/conv0.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/conv/conv0.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/conv/conv1.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/conv/conv1.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/conv/conv2.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/conv/conv2.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/conv/conv3.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/conv/conv3.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/conv/conv4.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/conv/conv4.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/conv/conv5.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/conv/conv5.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/conv/conv6.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/conv/conv6.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/conv/conv7.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/conv/conv7.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/conv/conv8.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/conv/conv8.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/conv/conv9.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/conv/conv9.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/pad/pad10.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/pad/pad10.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/pad/pad11.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/pad/pad11.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/pad/pad12.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/pad/pad12.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/pad/pad13.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/pad/pad13.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/pad/pad14.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/pad/pad14.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/pad/pad15.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/pad/pad15.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/pad/pad16.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/pad/pad16.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/pad/pad17.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/pad/pad17.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/pad/pad18.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/pad/pad18.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/docs/images/tflm_continuous_integration_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/docs/images/tflm_continuous_integration_1.png -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/dtln/dtln_noise_suppression.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/dtln/dtln_noise_suppression.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/micro_speech/testdata/no_1000ms.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/micro_speech/testdata/no_1000ms.wav -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/micro_speech/testdata/yes_1000ms.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/micro_speech/testdata/yes_1000ms.wav -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/micro_speech/testdata/yes_30ms.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/micro_speech/testdata/yes_30ms.wav -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/mnist_lstm/trained_lstm_int8.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/mnist_lstm/trained_lstm_int8.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/person_detection/testdata/person.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/person_detection/testdata/person.bmp -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/conv/conv10.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/conv/conv10.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/conv/conv11.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/conv/conv11.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/conv/conv12.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/conv/conv12.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/conv/conv13.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/conv/conv13.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/conv/conv14.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/conv/conv14.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/conv/conv15.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/conv/conv15.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/conv/conv16.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/conv/conv16.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/conv/conv17.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/conv/conv17.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/conv/conv18.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/conv/conv18.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/conv/conv19.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/conv/conv19.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/conv/conv20.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/conv/conv20.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/conv/conv21.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/conv/conv21.tflite -------------------------------------------------------------------------------- /third_party/xtensa/examples/micro_speech_lstm/images/lstm_model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/third_party/xtensa/examples/micro_speech_lstm/images/lstm_model.png -------------------------------------------------------------------------------- /third_party/xtensa/examples/pytorch_to_tflite/images/qat_model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/third_party/xtensa/examples/pytorch_to_tflite/images/qat_model.png -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/micro_speech/testdata/noise_1000ms.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/micro_speech/testdata/noise_1000ms.wav -------------------------------------------------------------------------------- /third_party/xtensa/examples/micro_speech_lstm/images/spectrogram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/third_party/xtensa/examples/micro_speech_lstm/images/spectrogram.png -------------------------------------------------------------------------------- /third_party/xtensa/nnlib_hifi4/BUILD: -------------------------------------------------------------------------------- 1 | alias( 2 | name = "nnlib_hifi4_lib", 3 | actual = "@nnlib_hifi4//:lib", 4 | visibility = [ 5 | "//visibility:public", 6 | ], 7 | ) 8 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/hello_world/images/hello_world_tflite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/hello_world/images/hello_world_tflite.png -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/hello_world/images/hello_world_tflm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/hello_world/images/hello_world_tflm.png -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/micro_speech/testdata/silence_1000ms.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/micro_speech/testdata/silence_1000ms.wav -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/person_detection/testdata/no_person.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/person_detection/testdata/no_person.bmp -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/quantize/quantize0.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/quantize/quantize0.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/quantize/quantize1.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/quantize/quantize1.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/python/tflite_size/tests/simple_add_model.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/python/tflite_size/tests/simple_add_model.tflite -------------------------------------------------------------------------------- /third_party/xtensa/examples/micro_speech_lstm/micro_speech_lstm.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/third_party/xtensa/examples/micro_speech_lstm/micro_speech_lstm.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/hello_world/models/hello_world_float.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/hello_world/models/hello_world_float.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/hello_world/models/hello_world_int8.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/hello_world/models/hello_world_int8.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/micro_speech/images/micro_speech_quantized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/micro_speech/images/micro_speech_quantized.png -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu0.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu0.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu1.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu1.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu10.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu10.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu11.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu11.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu12.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu12.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu13.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu13.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu14.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu14.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu15.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu15.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu16.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu16.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu17.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu17.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu18.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu18.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu19.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu19.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu2.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu2.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu20.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu20.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu21.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu21.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu22.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu22.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu3.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu3.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu4.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu4.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu5.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu5.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu6.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu6.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu7.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu7.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu8.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu8.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu9.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu9.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/memory_footprint/models/simple_add_model.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/memory_footprint/models/simple_add_model.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/micro_speech/images/audio_preprocessor_int8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/micro_speech/images/audio_preprocessor_int8.png -------------------------------------------------------------------------------- /data/continuous_builds/size_profiling/linux_x86_64_release/keyword_benchmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/data/continuous_builds/size_profiling/linux_x86_64_release/keyword_benchmark.png -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/memory_footprint/images/tflm_code_size_category.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/memory_footprint/images/tflm_code_size_category.png -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/micro_speech/models/audio_preprocessor_float.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/micro_speech/models/audio_preprocessor_float.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/micro_speech/models/audio_preprocessor_int8.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/micro_speech/models/audio_preprocessor_int8.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/micro_speech/models/micro_speech_quantized.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/examples/micro_speech/models/micro_speech_quantized.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice0.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice0.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice1.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice1.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice2.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice2.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice3.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice3.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice4.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice4.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice5.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice5.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice6.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice6.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice7.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice7.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice8.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice8.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice9.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice9.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/docs/images/preallocated_tensors/preallocated_tensors_bg_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/docs/images/preallocated_tensors/preallocated_tensors_bg_1.png -------------------------------------------------------------------------------- /tensorflow/lite/micro/docs/images/preallocated_tensors/preallocated_tensors_bg_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/docs/images/preallocated_tensors/preallocated_tensors_bg_2.png -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice10.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice10.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice11.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice11.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice12.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice12.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice13.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice13.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice14.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice14.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice15.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice15.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice16.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice16.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice17.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice17.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice18.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice18.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice19.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice19.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice20.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice20.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice21.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice21.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice22.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice22.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice23.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice23.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice24.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice24.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice25.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice25.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice26.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice26.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice27.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice27.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice28.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice28.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice29.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice29.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice30.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice30.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice31.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice31.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice32.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice32.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice33.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/strided_slice/strided_slice33.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/transpose_conv/transpose_conv0.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/transpose_conv/transpose_conv0.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/transpose_conv/transpose_conv1.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/transpose_conv/transpose_conv1.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/transpose_conv/transpose_conv2.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/transpose_conv/transpose_conv2.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/transpose_conv/transpose_conv3.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/transpose_conv/transpose_conv3.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/transpose_conv/transpose_conv4.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/integration_tests/seanet/transpose_conv/transpose_conv4.tflite -------------------------------------------------------------------------------- /tensorflow/lite/micro/docs/images/preallocated_tensors/preallocated_tensors_impl1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/tensorflow/lite/micro/docs/images/preallocated_tensors/preallocated_tensors_impl1.png -------------------------------------------------------------------------------- /third_party/xtensa/examples/pytorch_to_tflite/mobilenet_v2_quantized_1x3x224x224.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/third_party/xtensa/examples/pytorch_to_tflite/mobilenet_v2_quantized_1x3x224x224.tflite -------------------------------------------------------------------------------- /data/continuous_builds/size_profiling/linux_x86_64_release/baseline_memory_footprint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/data/continuous_builds/size_profiling/linux_x86_64_release/baseline_memory_footprint.png -------------------------------------------------------------------------------- /data/continuous_builds/size_profiling/linux_x86_64_release/interpreter_memory_footprint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/tflite-micro/HEAD/data/continuous_builds/size_profiling/linux_x86_64_release/interpreter_memory_footprint.png -------------------------------------------------------------------------------- /tensorflow/lite/core/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_cc//cc:cc_library.bzl", "cc_library") 2 | 3 | cc_library( 4 | name = "macros", 5 | hdrs = ["macros.h"], 6 | visibility = [ 7 | "//tensorflow/lite:__subpackages__", 8 | ], 9 | ) 10 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/sub/sub1_input1_int16.csv: -------------------------------------------------------------------------------- 1 | -4248,7339,-10839,-13516,-23178,-309,-11923,-3104,-30059,2149,24865,-24650,-27715,-29580,18876,-29246,13743,-5346,-18547,29175,16451,14056,-27567,4229,-11362,12139,-25861,17968,26494,-24268,25913,-30309 2 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/sub/sub2_input1_int16.csv: -------------------------------------------------------------------------------- 1 | 17983,-7437,8134,-1755,-31832,-15306,25132,22005,29372,-28307,-25022,15663,-22938,3812,-32763,-19705,-29077,-11508,-5039,-8941,-25949,-25323,32529,-4525,-29189,30519,-19558,12084,-13387,28918,15129,32497 2 | -------------------------------------------------------------------------------- /.github/ci-error-template.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Failed CI Test 3 | labels: bug 4 | --- 5 | There was a failed test in the CI pipeline for [PR {{ env.PR_NUM }}]({{ env.PR_LINK }}). Please see comments in the PR for more details. 6 | 7 | This issue automatically generated for notification purposes. 8 | -------------------------------------------------------------------------------- /.github/scheduled-error-template.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Scheduled workflow failed 3 | labels: bug 4 | --- 5 | {{ env.WORKFLOW }} run number {{ env.RUN_NUMBER }} failed. Please examine the run itself for more details. 6 | 7 | This issue has been automatically generated for notification purposes. 8 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/kernels/README.md: -------------------------------------------------------------------------------- 1 | # Info 2 | 3 | * [Porting Ops from Lite to Micro](../docs/porting_reference_ops.md) explains, 4 | step-by-step, the code changes necessary to port an op from lite to micro, 5 | and the process of submitting them for review and acceptance by the project. 6 | -------------------------------------------------------------------------------- /python/tflite_micro/README.pypi.md.in: -------------------------------------------------------------------------------- 1 | # TensorFlow Lite for Microcontrollers 2 | 3 | This package is built from commit 4 | [{STABLE_GIT_HASH}](https://github.com/tensorflow/tflite-micro/blob/{STABLE_GIT_HASH}/python/tflite_micro) 5 | of [github.com/tensorflow/tflite-micro](https://github.com/tensorflow/tflite-micro). 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /bazel-* 2 | /compile_commands.json 3 | *.swp 4 | .vscode/ 5 | *audio_frontend* 6 | *google* 7 | *__pycache__* 8 | venv 9 | gen 10 | 11 | # Ignore the directory in which `clangd` stores its local index. 12 | /.cache/ 13 | 14 | # Ignore the `external` symlink added by `bazel-compile-commands-extractor` 15 | /external 16 | -------------------------------------------------------------------------------- /data/continuous_builds/README.md: -------------------------------------------------------------------------------- 1 | This folder contains some artifacts auto generated from continuous build workflow. The 2 | intention is to monitor these artifacts, such as size data, to measure and 3 | detect any performance variation. The long term goal is to monitor these 4 | performance data points through some dashboard based on these artifacts. 5 | -------------------------------------------------------------------------------- /tensorflow/lite/experimental/microfrontend/README.md: -------------------------------------------------------------------------------- 1 | This directory contains the subset of functionality that is needed to run the 2 | micro_speech example with TFLM. 3 | 4 | The source of truth for the experimental microfrontend in TfLite is at: 5 | https://github.com/tensorflow/tflite-micro/blob/main/tensorflow/lite/experimental/microfrontend 6 | 7 | -------------------------------------------------------------------------------- /tensorflow/lite/build_def.bzl: -------------------------------------------------------------------------------- 1 | def tflite_copts(): 2 | """Defines common compile time flags for TFLite libraries.""" 3 | copts = [ 4 | "-DFARMHASH_NO_CXX_STRING", 5 | "-Wno-sign-compare", 6 | "-Wno-unused-parameter", 7 | "-fno-exceptions", # Exceptions are unused in TFLite. 8 | ] 9 | return copts 10 | -------------------------------------------------------------------------------- /tensorflow/lite/experimental/microfrontend/lib/kiss_fft_int16.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "tensorflow/lite/experimental/microfrontend/lib/kiss_fft_common.h" 4 | 5 | #define FIXED_POINT 16 6 | namespace kissfft_fixed16 { 7 | #include "kiss_fft.c" 8 | #include "tools/kiss_fftr.c" 9 | } // namespace kissfft_fixed16 10 | #undef FIXED_POINT 11 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/tools/github/arm/vcpkg-configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "registries": [ 3 | { 4 | "name": "arm", 5 | "kind": "artifact", 6 | "location": "https://artifacts.tools.arm.com/vcpkg-registry" 7 | } 8 | ], 9 | "requires": { 10 | "arm:compilers/arm/armclang": "6.22.0", 11 | "arm:models/arm/avh-fvp": "^11.27.31" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /signal/micro/kernels/pcan_flexbuffers_generated_data.cc: -------------------------------------------------------------------------------- 1 | #include "signal/micro/kernels/pcan_flexbuffers_generated_data.h" 2 | 3 | const int g_gen_data_size_snr_shift_6_test = 20; 4 | const unsigned char g_gen_data_snr_shift_6_test[] = { 5 | 0x73, 0x6e, 0x72, 0x5f, 0x73, 0x68, 0x69, 0x66, 0x74, 0x00, 6 | 0x01, 0x0b, 0x01, 0x01, 0x01, 0x06, 0x04, 0x02, 0x24, 0x01, 7 | }; 8 | -------------------------------------------------------------------------------- /signal/micro/kernels/pcan_flexbuffers_generated_data.h: -------------------------------------------------------------------------------- 1 | #ifndef SIGNAL_MICRO_KERNELS_PCAN_FLEXBUFFERS_GENERATED_DATA_H_ 2 | #define SIGNAL_MICRO_KERNELS_PCAN_FLEXBUFFERS_GENERATED_DATA_H_ 3 | 4 | extern const int g_gen_data_size_snr_shift_6_test; 5 | extern const unsigned char g_gen_data_snr_shift_6_test[]; 6 | 7 | #endif // SIGNAL_MICRO_KERNELS_PCAN_FLEXBUFFERS_GENERATED_DATA_H_ 8 | -------------------------------------------------------------------------------- /python/tests/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_cc//cc:cc_test.bzl", "cc_test") 2 | 3 | cc_test( 4 | name = "cc_deps_link_test", 5 | size = "small", 6 | srcs = [ 7 | "cc_deps_link_test.cc", 8 | ], 9 | tags = [ 10 | "nomsan", # avoid, because tensorflow library fails msan 11 | ], 12 | deps = [ 13 | "@tensorflow_cc_deps//:cc_library", 14 | ], 15 | ) 16 | -------------------------------------------------------------------------------- /tensorflow/compiler/mlir/lite/kernels/internal/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_cc//cc:cc_library.bzl", "cc_library") 2 | 3 | package( 4 | default_visibility = ["//visibility:public"], 5 | licenses = ["notice"], 6 | ) 7 | 8 | cc_library( 9 | name = "compatibility_macros", 10 | hdrs = ["compatibility_macros.h"], 11 | deps = ["//tensorflow/lite/kernels/internal:compatibility"], 12 | ) 13 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the list of Tensorflow's significant contributors. 2 | # 3 | # This does not necessarily list everyone who has contributed code, 4 | # especially since many employees of one corporation may be contributing. 5 | # To see the full list of contributors, see the revision history in 6 | # source control. 7 | 8 | Google LLC 9 | Yuan Tang 10 | Arm Ltd 11 | 12 | -------------------------------------------------------------------------------- /python/tflite_micro/signal/ops/testdata/filter_bank_accumulation_16k.txt: -------------------------------------------------------------------------------- 1 | 257 16000 125.0 3800.0 25 5 122 2 | 43352 3 | 61587 4 | 82655 5 | 110528 6 | 139607 7 | 173009 8 | 213758 9 | 265032 10 | 321372 11 | 382003 12 | 460187 13 | 545621 14 | 649849 15 | 761362 16 | 904955 17 | 1052886 18 | 1230922 19 | 1448884 20 | 1674101 21 | 1960672 22 | 2262187 23 | 2621637 24 | 3048830 25 | 3522818 26 | 4055575 -------------------------------------------------------------------------------- /python/tflite_micro/signal/ops/testdata/filter_bank_accumulation_44k.txt: -------------------------------------------------------------------------------- 1 | 1025 44100 125.0 3800.0 25 7 177 2 | 88928 3 | 130900 4 | 177498 5 | 229636 6 | 290802 7 | 366442 8 | 455869 9 | 557023 10 | 666091 11 | 811407 12 | 972244 13 | 1144538 14 | 1367988 15 | 1616725 16 | 1889658 17 | 2224246 18 | 2601615 19 | 3033067 20 | 3541380 21 | 4113125 22 | 4774754 23 | 5532980 24 | 6404370 25 | 7413694 26 | 8552917 -------------------------------------------------------------------------------- /python/tflite_micro/signal/ops/testdata/filter_bank_accumulation_8k.txt: -------------------------------------------------------------------------------- 1 | 129 8000 125.000000 3800.000000 25 5 122 2 | 43352 3 | 61587 4 | 82655 5 | 110528 6 | 139607 7 | 173009 8 | 213758 9 | 265032 10 | 321372 11 | 382003 12 | 460187 13 | 545621 14 | 649849 15 | 761362 16 | 904955 17 | 1052886 18 | 1230922 19 | 1448884 20 | 1674101 21 | 1960672 22 | 2262187 23 | 2621637 24 | 3048830 25 | 3522818 26 | 4055575 -------------------------------------------------------------------------------- /tools/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_python//python:defs.bzl", "py_binary", "py_test") 2 | 3 | package( 4 | default_visibility = ["//visibility:public"], 5 | ) 6 | 7 | py_binary( 8 | name = "expand_stamp_vars", 9 | srcs = ["expand_stamp_vars.py"], 10 | ) 11 | 12 | py_test( 13 | name = "expand_stamp_vars_test", 14 | srcs = ["expand_stamp_vars_test.py"], 15 | deps = [":expand_stamp_vars"], 16 | ) 17 | -------------------------------------------------------------------------------- /python/tests/cc_deps_link_test.cc: -------------------------------------------------------------------------------- 1 | // A simple program to test the py_pkg_cc_deps repository rule by building and 2 | // linking against the Tensorflow library shipping in the Tensorflow Python 3 | // package. 4 | 5 | #include 6 | 7 | int main(int argc, char* argv[]) { 8 | const char* ptr = "test"; 9 | const size_t n = 4; 10 | tensorflow::PrintMemory(ptr, n); 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/tools/make/additional_kernels.inc: -------------------------------------------------------------------------------- 1 | # TODO(b/288938993): de-dupe internal wrapper directory and remove this 2 | MICROLITE_CC_KERNEL_SRCS += \ 3 | $(TENSORFLOW_ROOT)signal/src/kiss_fft_wrappers/kiss_fft_float.cc \ 4 | $(TENSORFLOW_ROOT)signal/src/kiss_fft_wrappers/kiss_fft_int16.cc \ 5 | $(TENSORFLOW_ROOT)signal/src/kiss_fft_wrappers/kiss_fft_int32.cc 6 | 7 | MICROLITE_CC_HDRS += \ 8 | $(wildcard $(TENSORFLOW_ROOT)signal/src/kiss_fft_wrappers/*.h) \ 9 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/sub/sub0_input1_int16.csv: -------------------------------------------------------------------------------- 1 | 16410,-22641,-26806,29919,-18761,-15004,-22480,-28931,6758,23874,5752,31362,24028,5655,11595,30929,9397,-32311,-18542,-22430,-23146,25341,2825,-17491,17435,10502,-24477,21961,-31094,22769,-14253,-24270,11528,-11115,15512,23751,30750,-19037,-10125,-29963,16205,-24000,-27816,-17296,32742,-28561,-6718,6011,3238,-32182,11044,3708,-27422,-29190,19788,-5043,8627,-15828,-26503,-26819,-4143,23766,-22576,-6098 2 | -------------------------------------------------------------------------------- /signal/testdata/BUILD: -------------------------------------------------------------------------------- 1 | # Test data for signal tests. This is used to store large arrays which would make tests less readable. 2 | 3 | load("@rules_cc//cc:cc_library.bzl", "cc_library") 4 | 5 | package( 6 | default_visibility = ["//signal/micro/kernels:__subpackages__"], 7 | licenses = ["notice"], 8 | ) 9 | 10 | cc_library( 11 | name = "fft_test_data", 12 | srcs = [ 13 | "fft_test_data.cc", 14 | ], 15 | hdrs = [ 16 | "fft_test_data.h", 17 | ], 18 | ) 19 | -------------------------------------------------------------------------------- /third_party/kissfft/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@rules_cc//cc:cc_library.bzl", "cc_library") 2 | 3 | package( 4 | default_visibility = ["//visibility:public"], 5 | ) 6 | 7 | licenses(["notice"]) # Apache 2.0 8 | 9 | exports_files(["COPYING"]) 10 | 11 | cc_library( 12 | name = "kiss_fftr", 13 | srcs = [ 14 | ], 15 | hdrs = [ 16 | "_kiss_fft_guts.h", 17 | "kiss_fft.c", 18 | "kiss_fft.h", 19 | "tools/kiss_fftr.c", 20 | "tools/kiss_fftr.h", 21 | ], 22 | ) 23 | -------------------------------------------------------------------------------- /tensorflow/compiler/mlir/lite/core/api/BUILD: -------------------------------------------------------------------------------- 1 | load("//tensorflow/lite:build_def.bzl", "tflite_copts") 2 | load( 3 | "//tensorflow/lite/micro:build_def.bzl", 4 | "tflm_cc_library", 5 | "tflm_copts", 6 | ) 7 | 8 | package( 9 | default_visibility = ["//visibility:public"], 10 | licenses = ["notice"], 11 | ) 12 | 13 | tflm_cc_library( 14 | name = "error_reporter", 15 | srcs = ["error_reporter.cc"], 16 | hdrs = ["error_reporter.h"], 17 | copts = tflm_copts() + tflite_copts(), 18 | deps = [], 19 | ) 20 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/hello_world/quantization/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_python//python:defs.bzl", "py_binary") 2 | load("@tflm_pip_deps//:requirements.bzl", "requirement") 3 | 4 | py_binary( 5 | name = "ptq", 6 | srcs = ["ptq.py"], 7 | data = ["//tensorflow/lite/micro/examples/hello_world/models:hello_world_float.tflite"], 8 | deps = [ 9 | requirement("absl_py"), 10 | requirement("numpy"), 11 | requirement("tensorflow-cpu"), 12 | "//python/tflite_micro:runtime", 13 | ], 14 | ) 15 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/tools/Makefile.inc: -------------------------------------------------------------------------------- 1 | MICROLITE_TOOL_ROOT_DIR := $(TENSORFLOW_ROOT)tensorflow/lite/micro/tools/ 2 | 3 | LAYER_BY_LAYER_OUPUT_SRCS := \ 4 | $(MICROLITE_TOOL_ROOT_DIR)/layer_by_layer.cc \ 5 | 6 | LAYER_BY_LAYER_OUPUT_HDRS := \ 7 | $(MICROLITE_TOOL_ROOT_DIR)benchmarking/op_resolver.h \ 8 | 9 | ifneq ($(TARGET), bluepill cortex_m_corstone_300 riscv32_generic hexagon) 10 | $(eval $(call microlite_test,layer_by_layer_output_tool,\ 11 | $(LAYER_BY_LAYER_OUPUT_SRCS),$(LAYER_BY_LAYER_OUPUT_HDRS),)) 12 | endif 13 | -------------------------------------------------------------------------------- /codegen/examples/hello_world/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_cc//cc:cc_binary.bzl", "cc_binary") 2 | load("//codegen:build_def.bzl", "tflm_inference_library") 3 | 4 | package(default_visibility = ["//visibility:public"]) 5 | 6 | tflm_inference_library( 7 | name = "hello_world_model", 8 | tflite_model = "//tensorflow/lite/micro/examples/hello_world/models:hello_world_int8.tflite", 9 | ) 10 | 11 | cc_binary( 12 | name = "hello_world", 13 | srcs = ["hello_world.cc"], 14 | deps = [ 15 | ":hello_world_model", 16 | "//tensorflow/lite/c:c_api_types", 17 | ], 18 | ) 19 | -------------------------------------------------------------------------------- /ci/install_cores_xplorer_11.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | mkdir /opt/xtensa/licenses 4 | 5 | mkdir -p /opt/xtensa/XtDevTools/install/tools/ 6 | tar xvzf XtensaTools_RI_2022_9_linux.tgz --dir /opt/xtensa/XtDevTools/install/tools/ 7 | 8 | 9 | ########### 10 | # Hifimini 11 | ########### 12 | cd /opt/xtensa/ 13 | tar xvzf mini1m1m_RI_2019_2_linux_w_keys.tgz --dir /opt/xtensa/licenses/ 14 | cd /opt/xtensa/licenses/RI-2019.2-linux/mini1m1m_RG/ 15 | 16 | ./install --xtensa-tools \ 17 | /opt/xtensa/XtDevTools/install/tools/RI-2019.2-linux/XtensaTools/ \ 18 | --no-default \ 19 | --no-replace 20 | -------------------------------------------------------------------------------- /ci/install_cores_xplorer_solo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | mkdir /opt/xtensa/licenses 4 | 5 | mkdir -p /opt/xtensa/XtDevTools/install/tools/ 6 | tar xvzf XtensaTools_RI_2022_9_linux.tgz --dir /opt/xtensa/XtDevTools/install/tools/ 7 | 8 | 9 | ########### 10 | # Hifi5 11 | ########### 12 | cd /opt/xtensa/ 13 | tar xvzf PRD_H5_RDO_07_01_2022_linux.tgz --dir /opt/xtensa/licenses/ 14 | cd /opt/xtensa/licenses/RI-2022.9-linux/PRD_H5_RDO_07_01_2022/ 15 | 16 | ./install --xtensa-tools \ 17 | /opt/xtensa/XtDevTools/install/tools/RI-2022.9-linux/XtensaTools/ \ 18 | --no-default \ 19 | --no-replace 20 | -------------------------------------------------------------------------------- /third_party/kissfft/workspace.bzl: -------------------------------------------------------------------------------- 1 | """Loads the kissfft library, used by TF Lite.""" 2 | 3 | load("//third_party:repo.bzl", "tf_http_archive") 4 | 5 | def repo(): 6 | tf_http_archive( 7 | name = "kissfft", 8 | patch_file = "//third_party/kissfft:kissfft.patch", 9 | strip_prefix = "kissfft-130", 10 | sha256 = "ac2259f84e372a582270ed7c7b709d02e6ca9c7206e40bb58de6ef77f6474872", 11 | urls = [ 12 | "https://github.com/mborgerding/kissfft/archive/refs/tags/v130.zip", 13 | ], 14 | build_file = "//third_party/kissfft:BUILD.bazel", 15 | ) 16 | -------------------------------------------------------------------------------- /signal/src/kiss_fft_wrappers/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_cc//cc:cc_library.bzl", "cc_library") 2 | 3 | package( 4 | default_visibility = ["//signal/src:__subpackages__"], 5 | licenses = ["notice"], 6 | ) 7 | 8 | cc_library( 9 | name = "kiss_fft_wrappers", 10 | srcs = [ 11 | "kiss_fft_float.cc", 12 | "kiss_fft_int16.cc", 13 | "kiss_fft_int32.cc", 14 | ], 15 | hdrs = [ 16 | "kiss_fft_common.h", 17 | "kiss_fft_float.h", 18 | "kiss_fft_int16.h", 19 | "kiss_fft_int32.h", 20 | ], 21 | deps = [ 22 | "@kissfft//:kiss_fftr", 23 | ], 24 | ) 25 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/tools/make/ext_libs/hexagon.inc: -------------------------------------------------------------------------------- 1 | MICROLITE_CC_KERNEL_SRCS += \ 2 | tensorflow/lite/micro/kernels/hexagon/fully_connected_int8.cc \ 3 | tensorflow/lite/micro/kernels/hexagon/svdf_int8.cc 4 | 5 | 6 | THIRD_PARTY_CC_SRCS += \ 7 | $(wildcard $(HEXAGON_ROOT)/$(HEXAGON_TOOL_VER)/Examples/libcore/SigProc/rFFT/asm_src/*.S) 8 | 9 | THIRD_PARTY_CC_HDRS += \ 10 | $(wildcard $(HEXAGON_ROOT)/$(HEXAGON_TOOL_VER)/Examples/libcore/include/*.h) 11 | 12 | INCLUDES += \ 13 | -I$(HEXAGON_ROOT)/$(HEXAGON_TOOL_VER)/Examples/libcore/include \ 14 | -I$(HEXAGON_ROOT)/$(HEXAGON_TOOL_VER)/Examples/libcore/SigProc/rFFT/include 15 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/micro_speech/train_speech_model.ipynb: -------------------------------------------------------------------------------- 1 | {"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"name":"Redirect","provenance":[],"collapsed_sections":[],"authorship_tag":"ABX9TyO1u6oks1qPVEQNnHFD3Cyo"},"kernelspec":{"name":"python3","display_name":"Python 3"}},"cells":[{"cell_type":"markdown","metadata":{"id":"86C-FMxpdZxv","colab_type":"text"},"source":["This Colab notebook has been moved to [https://github.com/tensorflow/tflite-micro/blob/main/tensorflow/lite/micro/examples/micro_speech/train/train_micro_speech_model.ipynb](https://github.com/tensorflow/tflite-micro/blob/main/tensorflow/lite/micro/examples/micro_speech/train/train_micro_speech_model.ipynb)\n"]}]} -------------------------------------------------------------------------------- /codegen/runtime/BUILD: -------------------------------------------------------------------------------- 1 | load("//tensorflow/lite/micro:build_def.bzl", "tflm_cc_library") 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | tflm_cc_library( 6 | name = "micro_codegen_context", 7 | srcs = ["micro_codegen_context.cc"], 8 | hdrs = ["micro_codegen_context.h"], 9 | deps = [ 10 | "//tensorflow/lite/c:common", 11 | "//tensorflow/lite/kernels:op_macros", 12 | "//tensorflow/lite/kernels/internal:compatibility", 13 | "//tensorflow/lite/micro:micro_context", 14 | "//tensorflow/lite/micro:micro_graph", 15 | "//tensorflow/lite/micro:micro_log", 16 | "//tensorflow/lite/micro:span", 17 | ], 18 | ) 19 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/tools/project_generation/BUILD.testing: -------------------------------------------------------------------------------- 1 | # standalone BUILD file used to test project generation with bazel. 2 | # 3 | load("//tensorflow/lite/micro:build_def.bzl", 4 | "tflm_cc_library", 5 | "tflm_copts", 6 | ) 7 | 8 | tflm_cc_library( 9 | name = "libtflm", 10 | srcs = glob(["tensorflow/**/*.cc", "tensorflow/**/*.c", "third_party/**/*.cc", "third_party/**/*.c"]), 11 | hdrs = glob(["tensorflow/**/*.h", "third_party/**/*.h"]), 12 | copts = tflm_copts() + [ 13 | "-Ithird_party/gemmlowp", 14 | "-Ithird_party/flatbuffers/include", 15 | "-Ithird_party/kissfft", 16 | "-Ithird_party/kissfft/tools", 17 | "-Ithird_party/ruy", 18 | ] 19 | ) 20 | 21 | -------------------------------------------------------------------------------- /python/tflite_micro/signal/ops/testdata/BUILD: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Test data for the signal library 3 | 4 | package( 5 | default_visibility = ["//signal:__subpackages__"], 6 | licenses = ["notice"], 7 | ) 8 | 9 | exports_files([ 10 | "energy_test1.txt", 11 | "fft_auto_scale_test1.txt", 12 | "filter_bank_accumulation_8k.txt", 13 | "filter_bank_accumulation_16k.txt", 14 | "filter_bank_accumulation_44k.txt", 15 | "filter_bank_test1.txt", 16 | "filter_bank_square_root_test1.txt", 17 | "filter_bank_spectral_subtraction_test1.txt", 18 | "framer_test1.txt", 19 | "pcan_op_test1.txt", 20 | "rfft_test1.txt", 21 | "stacker_test1.txt", 22 | "window_test1.txt", 23 | ]) 24 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/kernels/test_data_generation/README.md: -------------------------------------------------------------------------------- 1 | # Background 2 | 3 | As a Custom operator, detection_postprocess is using Flexbuffers library. In the 4 | unit test there is a need to use flexbuffers::Builder since the operator itself 5 | use flexbuffers::Map. However flexbuffers::Builder can not be used for most 6 | targets (basically only on X86), since it is using std::vector and std::map. 7 | Therefore the flexbuffers::Builder data is pregenerated on X86. 8 | 9 | # How to generate new data: 10 | 11 | ~~~ 12 | g++ -I ../../../micro/tools/make/downloads/flatbuffers/include generate_detection_postprocess_flexbuffers_data.cc && ./a.out > ../detection_postprocess_flexbuffers_generated_data.cc 13 | ~~~ 14 | -------------------------------------------------------------------------------- /third_party/ruy/workspace.bzl: -------------------------------------------------------------------------------- 1 | """Loads the ruy library, used by TensorFlow Lite.""" 2 | 3 | load("//third_party:repo.bzl", "tf_http_archive") 4 | 5 | def repo(): 6 | tf_http_archive( 7 | name = "ruy", 8 | sha256 = "da5ec0cc07472bdb21589b0b51c8f3d7f75d2ed6230b794912adf213838d289a", 9 | strip_prefix = "ruy-54774a7a2cf85963777289193629d4bd42de4a59", 10 | urls = [ 11 | "https://storage.googleapis.com/mirror.tensorflow.org/github.com/google/ruy/archive/54774a7a2cf85963777289193629d4bd42de4a59.zip", 12 | "https://github.com/google/ruy/archive/54774a7a2cf85963777289193629d4bd42de4a59.zip", 13 | ], 14 | build_file = "//third_party/ruy:BUILD", 15 | ) 16 | -------------------------------------------------------------------------------- /tensorflow/lite/python/BUILD: -------------------------------------------------------------------------------- 1 | load("@flatbuffers//:build_defs.bzl", "flatbuffer_py_library") 2 | load("@rules_python//python:defs.bzl", "py_library") 3 | load("@tflm_pip_deps//:requirements.bzl", "requirement") 4 | 5 | package( 6 | default_visibility = [ 7 | "//visibility:public", 8 | ], 9 | licenses = ["notice"], 10 | ) 11 | 12 | flatbuffer_py_library( 13 | name = "schema_py", 14 | srcs = ["//tensorflow/compiler/mlir/lite/schema:schema.fbs"], 15 | ) 16 | 17 | py_library( 18 | name = "schema_util", 19 | srcs = ["schema_util.py"], 20 | visibility = ["//:__subpackages__"], 21 | deps = [ 22 | requirement("flatbuffers"), 23 | requirement("tensorflow-cpu"), 24 | ], 25 | ) 26 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an Issue or Pull Request becomes stale 2 | daysUntilStale: 30 3 | # Number of days of inactivity before a stale Issue or Pull Request is closed 4 | daysUntilClose: 15 5 | # Comment to post when marking as stale. Set to `false` to disable 6 | markComment: > 7 | This issue has been automatically marked as stale because it has no 8 | recent activity. It will be closed if no further activity occurs. Thank you. 9 | # Comment to post when removing the stale label. Set to `false` to disable 10 | unmarkComment: false 11 | closeComment: > 12 | Closing as stale. Please reopen if you'd like to work on this further. 13 | limitPerRun: 30 14 | # Limit to only `issues` or `pulls` 15 | only: issues 16 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/kernels/test_data_generation/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_cc//cc:cc_binary.bzl", "cc_binary") 2 | 3 | package( 4 | # Disabling layering_check because of http://b/177257332 5 | features = ["-layering_check"], 6 | licenses = ["notice"], 7 | ) 8 | 9 | cc_binary( 10 | name = "generate_detection_postprocess_flexbuffers_data", 11 | srcs = [ 12 | "generate_detection_postprocess_flexbuffers_data.cc", 13 | ], 14 | deps = [ 15 | "@flatbuffers", 16 | ], 17 | ) 18 | 19 | cc_binary( 20 | name = "generate_circular_buffer_flexbuffers_data", 21 | srcs = [ 22 | "generate_circular_buffer_flexbuffers_data.cc", 23 | ], 24 | deps = [ 25 | "@flatbuffers", 26 | ], 27 | ) 28 | -------------------------------------------------------------------------------- /third_party/flatbuffers/workspace.bzl: -------------------------------------------------------------------------------- 1 | """Loads the Flatbuffers library, used by TF Lite.""" 2 | 3 | load("//third_party:repo.bzl", "tf_http_archive") 4 | 5 | def repo(): 6 | tf_http_archive( 7 | name = "flatbuffers", 8 | strip_prefix = "flatbuffers-23.5.26", 9 | sha256 = "1cce06b17cddd896b6d73cc047e36a254fb8df4d7ea18a46acf16c4c0cd3f3f3", 10 | urls = [ 11 | "https://github.com/google/flatbuffers/archive/v23.5.26.tar.gz", 12 | ], 13 | build_file = "//third_party/flatbuffers:BUILD.oss", 14 | system_build_file = "//third_party/flatbuffers:BUILD.system", 15 | link_files = { 16 | "//third_party/flatbuffers:build_defs.bzl": "build_defs.bzl", 17 | }, 18 | ) 19 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/ceva/micro_time.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | -------------------------------------------------------------------------------- /BUILD: -------------------------------------------------------------------------------- 1 | load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") 2 | load("@hedron_compile_commands//:refresh_compile_commands.bzl", "refresh_compile_commands") 3 | 4 | # `bazel run` this target to generate compile_commands.json, which can be used 5 | # by various tools like editors and LSPs to provide features like intelligent 6 | # navigation and autocompletion based on the source graph and compiler commands. 7 | refresh_compile_commands( 8 | name = "refresh_compile_commands", 9 | targets = ["//..."], 10 | ) 11 | 12 | bool_flag( 13 | name = "with_compression", 14 | build_setting_default = False, 15 | ) 16 | 17 | config_setting( 18 | name = "with_compression_enabled", 19 | flag_values = { 20 | ":with_compression": "True", 21 | }, 22 | ) 23 | -------------------------------------------------------------------------------- /tensorflow/lite/c/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_cc//cc:cc_library.bzl", "cc_library") 2 | load( 3 | "//tensorflow/lite:build_def.bzl", 4 | "tflite_copts", 5 | ) 6 | 7 | package( 8 | default_visibility = ["//visibility:public"], 9 | licenses = ["notice"], 10 | ) 11 | 12 | cc_library( 13 | name = "common", 14 | hdrs = [ 15 | "builtin_op_data.h", 16 | "common.h", 17 | ], 18 | copts = tflite_copts(), 19 | deps = [ 20 | ":c_api_types", 21 | "//tensorflow/lite/core/c:c_api_types", 22 | "//tensorflow/lite/core/c:common", 23 | ], 24 | ) 25 | 26 | cc_library( 27 | name = "c_api_types", 28 | hdrs = ["c_api_types.h"], 29 | copts = tflite_copts(), 30 | deps = [ 31 | "//tensorflow/lite/core/c:c_api_types", 32 | ], 33 | ) 34 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/python/interpreter/src/BUILD: -------------------------------------------------------------------------------- 1 | load( 2 | "//tensorflow:extra_rules.bzl", 3 | "tflm_python_op_resolver_friends", 4 | ) 5 | load( 6 | "//tensorflow/lite/micro:build_def.bzl", 7 | "tflm_cc_library", 8 | ) 9 | 10 | package( 11 | features = ["-layering_check"], 12 | licenses = ["notice"], 13 | ) 14 | 15 | package_group( 16 | name = "op_resolver_friends", 17 | packages = tflm_python_op_resolver_friends(), 18 | ) 19 | 20 | # TODO(b/286456378): remove once all internal usage is fixed. 21 | tflm_cc_library( 22 | name = "python_ops_resolver", 23 | srcs = [], 24 | hdrs = [ 25 | "python_ops_resolver.h", 26 | ], 27 | visibility = [":op_resolver_friends"], 28 | deps = [ 29 | "//python/tflite_micro:python_ops_resolver", 30 | ], 31 | ) 32 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Define the project's code formatting styles 2 | # 3 | # https://editorconfig.org 4 | # 5 | # EditorConfig is a file format for defining coding styles. EditorConfig is 6 | # natively supported by VisualStudio, GitHub, Neovim, etc. 7 | 8 | [*] 9 | # Unix-style newlines and a newline ending in every file 10 | end_of_line = lf 11 | insert_final_newline = true 12 | 13 | [*.{cc,h}] 14 | # https://google.github.io/styleguide/cppguide.html 15 | indent_style = space 16 | indent_size = 2 17 | 18 | [*.py] 19 | # https://google.github.io/styleguide/pyguide.html but 2-space indent 20 | indent_style = space 21 | indent_size = 2 22 | max_line_length = 79 23 | 24 | [WORKSPACE,BUILD,*.bzl] 25 | # https://bazel.build/build/style-guide 26 | indent_style = space 27 | indent_size = 4 28 | 29 | [Makefile] 30 | indent_style = tab 31 | -------------------------------------------------------------------------------- /tensorflow/lite/core/c/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_cc//cc:cc_library.bzl", "cc_library") 2 | load( 3 | "//tensorflow/lite:build_def.bzl", 4 | "tflite_copts", 5 | ) 6 | 7 | package( 8 | default_visibility = ["//visibility:public"], 9 | licenses = ["notice"], 10 | ) 11 | 12 | cc_library( 13 | name = "common", 14 | srcs = ["common.cc"], 15 | hdrs = [ 16 | "builtin_op_data.h", 17 | "common.h", 18 | ], 19 | copts = tflite_copts(), 20 | deps = [ 21 | ":c_api_types", 22 | "//tensorflow/compiler/mlir/lite/core/c:tflite_common", 23 | ], 24 | ) 25 | 26 | cc_library( 27 | name = "c_api_types", 28 | hdrs = ["c_api_types.h"], 29 | copts = tflite_copts(), 30 | deps = [ 31 | "//tensorflow/compiler/mlir/lite/core/c:tflite_common", 32 | ], 33 | ) 34 | -------------------------------------------------------------------------------- /third_party/xtensa/examples/pytorch_to_tflite/README.md: -------------------------------------------------------------------------------- 1 | # Setup Xtensa Tools 2 | $ set path = ( ~/xtensa/XtDevTools/install/tools/RI-2020.5-linux/XtensaTools/bin $path ) 3 | 4 | $ set path = ( ~/xtensa/XtDevTools/install/tools/RI-2020.5-linux/XtensaTools/Tools/bin $path ) 5 | 6 | $ setenv XTENSA_SYSTEM ~xtensa/XtDevTools/install/tools/RI-2020.5-linux/XtensaTools/config 7 | 8 | $ setenv XTENSA_CORE AE_HiFi5_LE5_AO_FP_XC 9 | 10 | $ setenv XTENSA_TOOLS_VERSION RI-2020.5-linux 11 | 12 | $ setenv XTENSA_BASE ~/xtensa/XtDevTools/install/ 13 | 14 | 15 | # Clean and build mobilenet_v2 model on TFLM 16 | $ make -f tensorflow/lite/micro/tools/make/Makefile clean 17 | 18 | $ make -f tensorflow/lite/micro/tools/make/Makefile TARGET=xtensa OPTIMIZED_KERNEL_DIR=xtensa TARGET=xtensa TARGET_ARCH=hifi5 test_pytorch_to_tflite_test -j 19 | -------------------------------------------------------------------------------- /tensorflow/lite/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_cc//cc:cc_library.bzl", "cc_library") 2 | 3 | package( 4 | default_visibility = ["//visibility:public"], 5 | licenses = ["notice"], 6 | ) 7 | 8 | cc_library( 9 | name = "array", 10 | srcs = ["array.cc"], 11 | hdrs = ["array.h"], 12 | deps = [ 13 | "//tensorflow/lite/c:common", 14 | "//tensorflow/lite/core/c:common", 15 | ], 16 | ) 17 | 18 | cc_library( 19 | name = "type_to_tflitetype", 20 | hdrs = [ 21 | "portable_type_to_tflitetype.h", 22 | ], 23 | deps = ["//tensorflow/lite/c:common"], 24 | ) 25 | 26 | cc_library( 27 | name = "kernel_api", 28 | hdrs = [ 29 | "builtin_op_data.h", 30 | "builtin_ops.h", 31 | "context_util.h", 32 | ], 33 | deps = [ 34 | "//tensorflow/lite/c:common", 35 | ], 36 | ) 37 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/tools/dev_setup/pre-push.tflm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright 2019 The TensorFlow Authors. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # ============================================================================== 16 | 17 | tensorflow/lite/micro/tools/ci_build/test_code_style.sh 18 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_python//python:defs.bzl", "py_binary") 2 | load("@tflm_pip_deps//:requirements.bzl", "requirement") 3 | 4 | package(licenses = ["notice"]) 5 | 6 | py_binary( 7 | name = "generate_per_layer_tests", 8 | srcs = [ 9 | "generate_per_layer_tests.py", 10 | ], 11 | data = [ 12 | "templates/BUILD.mako", 13 | "templates/integration_tests_cc.mako", 14 | ], 15 | visibility = ["//:__subpackages__"], 16 | deps = [ 17 | requirement("absl_py"), 18 | requirement("mako"), 19 | requirement("tensorflow-cpu"), 20 | "//tensorflow/lite/micro/tools:generate_test_for_model", 21 | "//tensorflow/lite/python:schema_py", 22 | "//tensorflow/lite/python:schema_util", 23 | "//tensorflow/lite/tools:flatbuffer_utils", 24 | ], 25 | ) 26 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/testing/robot.resource.txt: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Teardown With Custom Message 3 | Test Teardown 4 | [Documentation] Replace robot fail message with whole UART output 5 | ${UART_LOGS} Get File ${UART_LOG} 6 | Set Test Message UART OUTPUT:\n\n${UART_LOGS} 7 | Remove File ${UART_LOG} 8 | 9 | Create Platform 10 | Execute Command $logfile=@${UART_LOG} 11 | Execute Script ${RESC} 12 | Provides ready-platform Reexecution 13 | 14 | Test Binary 15 | [Arguments] ${BIN} 16 | Requires ready-platform 17 | Execute Command sysbus LoadELF ${BIN} 18 | 19 | Create Terminal Tester ${UART} timeout=30 20 | Start Emulation 21 | 22 | Wait For Line On Uart ${UART_LINE_ON_SUCCESS} 23 | 24 | -------------------------------------------------------------------------------- /codegen/examples/hello_world/README.md: -------------------------------------------------------------------------------- 1 | # Codegen Hello World Example 2 | 3 | This is a code-generated example of the hello world model. The generated source 4 | is checked in for now so that it can be reviewed during the prototyping stage. 5 | 6 | ## Building the example executable 7 | Please note that this will execute Bazel from make as part of the process. 8 | 9 | ``` 10 | bazel build //codegen/examples/hello_world:hello_world 11 | ``` 12 | 13 | ## Running the example 14 | 15 | TODO(rjascani): The command works, but it'll just crash as we don't have all of 16 | the data structures fully populated yet. 17 | 18 | ``` 19 | bazel run //codegen/examples/hello_world:hello_world 20 | ``` 21 | 22 | ## Updating the generated sources 23 | To update the generated source, you can execute this make target: 24 | 25 | ``` 26 | ./codegen/examples/hello_world/update_example_source.sh 27 | ``` 28 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/compression/view_test.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 The TensorFlow Authors. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import sys 16 | import view 17 | 18 | # The test simply makes sure the viewer runs without returning an error. 19 | 20 | model_path = sys.argv[1] 21 | view.print_model(model_path) 22 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/dtln/dtln_inout_data.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "tensorflow/lite/c/common.h" 17 | 18 | extern int8_t feature_data[]; 19 | extern int8_t golden_ref[]; 20 | -------------------------------------------------------------------------------- /tensorflow/compiler/mlir/lite/core/c/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_cc//cc:cc_library.bzl", "cc_library") 2 | load("//tensorflow/lite:build_def.bzl", "tflite_copts") 3 | 4 | package( 5 | default_visibility = [ 6 | "//visibility:public", 7 | ], 8 | licenses = ["notice"], 9 | ) 10 | 11 | exports_files( 12 | srcs = [ 13 | "builtin_op_data.h", 14 | "tflite_types.h", 15 | ], 16 | visibility = [ 17 | "//tensorflow/lite:__subpackages__", 18 | ], 19 | ) 20 | 21 | # LINT.IfChange(common) 22 | cc_library( 23 | name = "tflite_common", 24 | srcs = [], 25 | hdrs = [ 26 | "builtin_op_data.h", 27 | "tflite_types.h", 28 | ], 29 | copts = tflite_copts(), 30 | visibility = ["//visibility:public"], 31 | alwayslink = 1, # Why?? TODO(b/161243354): eliminate this. 32 | ) 33 | # LINT.ThenChange(//tensorflow/lite/core/c:common) 34 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/python/interpreter/src/runtime.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # ============================================================================== 15 | 16 | # TODO(b/286456378): remove once all usage is switched to runtime 17 | from tflite_micro.python.tflite_micro.runtime import * 18 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/python/interpreter/src/tflm_runtime.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # ============================================================================== 15 | 16 | # TODO(b/286456378): remove once all usage is switched to runtime 17 | from tflite_micro.python.tflite_micro.runtime import * 18 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/python/tflite_size/tests/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_python//python:defs.bzl", "py_test") 2 | load("@tflm_pip_deps//:requirements.bzl", "requirement") 3 | 4 | licenses(["notice"]) 5 | 6 | filegroup( 7 | name = "test_resources", 8 | srcs = [ 9 | "gold_simple_add_model_html.txt", 10 | "gold_simple_add_model_json.txt", 11 | "simple_add_model.tflite", 12 | ], 13 | ) 14 | 15 | py_test( 16 | name = "flatbuffer_size_test", 17 | srcs = ["flatbuffer_size_test.py"], 18 | data = [ 19 | ":test_resources", 20 | ], 21 | main = "flatbuffer_size_test.py", 22 | tags = [ 23 | "noasan", 24 | "nomsan", # Python doesn't like these symbols from flatbuffer_size_wrapper_pybind.so 25 | "noubsan", 26 | ], 27 | deps = [ 28 | requirement("tensorflow-cpu"), 29 | "//tensorflow/lite/micro/python/tflite_size/src:flatbuffer_size", 30 | ], 31 | ) 32 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/tools/make/ext_libs/xi_tflmlib_vision_p6.patch: -------------------------------------------------------------------------------- 1 | From ed92529a6be7a910462558edcf10070fbb0f2870 Mon Sep 17 00:00:00 2001 2 | From: Ryan Kuester 3 | Date: Thu, 1 Aug 2024 12:48:12 -0500 4 | Subject: [PATCH] fix: use instead of to access INT_MAX and 5 | friends 6 | 7 | For compatibility with the C++ library standard, use the header, 8 | , to access constants such as INT_MAX. 9 | --- 10 | runtime/include/cnnrt_xi.h | 2 +- 11 | 1 file changed, 1 insertion(+), 1 deletion(-) 12 | 13 | diff --git a/runtime/include/cnnrt_xi.h b/runtime/include/cnnrt_xi.h 14 | index f3a911e..00c74b8 100644 15 | --- a/runtime/include/cnnrt_xi.h 16 | +++ b/runtime/include/cnnrt_xi.h 17 | @@ -25,7 +25,7 @@ 18 | # define INCLUDE_XI_CNN 19 | #endif 20 | 21 | -#include 22 | +#include 23 | #include "xi_api.h" 24 | #include "xi_cnn_api.h" 25 | #include "xi_tile_manager.h" 26 | -- 27 | 2.43.0 28 | 29 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/person_detection/model_settings.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "tensorflow/lite/micro/examples/person_detection/model_settings.h" 17 | 18 | const char* kCategoryLabels[kCategoryCount] = { 19 | "notperson", 20 | "person", 21 | }; 22 | -------------------------------------------------------------------------------- /ci/install_bazelisk.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2021 The TensorFlow Authors. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # ============================================================================== 16 | 17 | set -e 18 | wget https://github.com/bazelbuild/bazelisk/releases/download/v1.27.0/bazelisk-linux-amd64 19 | mv bazelisk-linux-amd64 bazel 20 | chmod +x bazel 21 | mv bazel /usr/local/bin 22 | -------------------------------------------------------------------------------- /signal/src/kiss_fft_wrappers/kiss_fft_float.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "signal/src/kiss_fft_wrappers/kiss_fft_common.h" 17 | 18 | #undef FIXED_POINT 19 | namespace kiss_fft_float { 20 | #include "kiss_fft.c" 21 | #include "tools/kiss_fftr.c" 22 | } // namespace kiss_fft_float 23 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu11_golden_int16.csv: -------------------------------------------------------------------------------- 1 | 22500,6249,-3082,-8137,-8287,9219,32767,-4514,24011,6168,-10827,-5306,-9730,-3596,14504,-2173,29898,-10764,-3528,17840,974,2560,-5616,32767,3906,11974,27829,26515,32767,-8307,8921,-4162,-4934,-10047,6278,15108,8811,21890,-3223,-857,-1637,-7455,-1806,11236,-9113,32767,31605,-2439,-2108,-1460,8757,2063,-2012,-7112,27178,-7525,-3749,-2365,-4723,19800,26344,13526,23589,2954,-6033,31490,-7965,20026,3750,-60,-9559,1958,9237,6097,31167,-10671,30710,3096,19694,-10852,-10315,-229,-6473,11763,-7883,-563,-4233,20624,18169,27474,18240,31765,-9179,17502,18706,-6207,-2927,-8502,31632,-7589,15038,-10123,-7847,-3144,30728,-10737,32767,-2917,11408,7363,-9440,6699,-1526,10405,7639,-3988,-4408,453,19578,4377,-6930,24071,-821,15003,1021,-8336,-10813,-6664,32243,-1133,-1252,-2843,23359,32767,-8416,-10866,19195,13918,-5119,-7798,28218,-45,22930,1513,-4755,25158,-7821,-2244,30080,-6964,22085,21967,18286,4031,17468,6776,-6398,-7563,27208,-9605 2 | -------------------------------------------------------------------------------- /third_party/xtensa/examples/pytorch_to_tflite/pytorch_op_resolver.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "tensorflow/lite/micro/micro_mutable_op_resolver.h" 17 | 18 | using PytorchOpsResolver = tflite::MicroMutableOpResolver<128>; 19 | 20 | TfLiteStatus InitPytorchOpsResolver(PytorchOpsResolver& resolver); 21 | -------------------------------------------------------------------------------- /python/tflite_micro/pypi_build.dockerfile: -------------------------------------------------------------------------------- 1 | # Use the Python Packaging Authority's reference build environment 2 | # for binary extensions. Binary extensions are typically built and distributed 3 | # for each target Python version and OS platform. The reference build 4 | # environment contains Python installations for each version, and a C/C++ 5 | # toolchain specified for maximum compatibility among x86_64 Linux paltforms. 6 | FROM quay.io/pypa/manylinux_2_28_x86_64 7 | 8 | # Install bazel (via bazelisk) 9 | ENV BAZELISK=https://github.com/bazelbuild/bazelisk/releases/download/v1.18.0/bazelisk-linux-amd64 10 | ENV BAZEL=/usr/local/bin/bazel 11 | RUN curl --output $BAZEL --location $BAZELISK && chmod 755 $BAZEL 12 | 13 | # Append the location of the C/C++ toolchain to the default PATH, where 14 | # bazel expects to find it. The reference environment provides the location 15 | # (typically somewhere under /opt) in DEVTOOLSET_ROOTPATH. 16 | RUN echo "PATH="${PATH}:/${DEVTOOLSET_ROOTPATH}"" >>/etc/environment 17 | -------------------------------------------------------------------------------- /tensorflow/lite/kernels/internal/reference/integer_ops/mean.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_INTEGER_OPS_MEAN_H_ 16 | #define TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_INTEGER_OPS_MEAN_H_ 17 | 18 | #endif // TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_INTEGER_OPS_MEAN_H_ 19 | -------------------------------------------------------------------------------- /tensorflow/lite/schema/schema_utils.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_SCHEMA_SCHEMA_UTILS_H_ 16 | #define TENSORFLOW_LITE_SCHEMA_SCHEMA_UTILS_H_ 17 | 18 | #include "tensorflow/compiler/mlir/lite/schema/schema_utils.h" // IWYU pragma: keep 19 | 20 | #endif // TENSORFLOW_LITE_SCHEMA_SCHEMA_UTILS_H_ 21 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/tools/ci_build/binary_size_test/Makefile.inc: -------------------------------------------------------------------------------- 1 | # Copyright 2021 The TensorFlow Authors. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # ============================================================================== 15 | 16 | 17 | # This is used to test binary size workflow. 18 | $(eval $(call microlite_test,binary_size_test,\ 19 | $(TENSORFLOW_ROOT)tensorflow/lite/micro/tools/ci_build/binary_size_test/binary_size_test.cc)) 20 | -------------------------------------------------------------------------------- /signal/src/kiss_fft_wrappers/kiss_fft_int16.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "signal/src/kiss_fft_wrappers/kiss_fft_common.h" 17 | 18 | #define FIXED_POINT 16 19 | namespace kiss_fft_fixed16 { 20 | #include "kiss_fft.c" 21 | #include "tools/kiss_fftr.c" 22 | } // namespace kiss_fft_fixed16 23 | #undef FIXED_POINT 24 | -------------------------------------------------------------------------------- /signal/src/kiss_fft_wrappers/kiss_fft_int32.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "signal/src/kiss_fft_wrappers/kiss_fft_common.h" 17 | 18 | #define FIXED_POINT 32 19 | namespace kiss_fft_fixed32 { 20 | #include "kiss_fft.c" 21 | #include "tools/kiss_fftr.c" 22 | } // namespace kiss_fft_fixed32 23 | #undef FIXED_POINT 24 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/tools/ci_build/test_bazel.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2019 The TensorFlow Authors. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # ============================================================================== 16 | 17 | set -e 18 | set -x 19 | 20 | SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 21 | ROOT_DIR=${SCRIPT_DIR}/../../../../.. 22 | cd "${ROOT_DIR}" 23 | 24 | bazel test //... \ 25 | --config=ci 26 | -------------------------------------------------------------------------------- /tensorflow/lite/kernels/internal/runtime_shape.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "tensorflow/lite/kernels/internal/runtime_shape.h" 17 | 18 | namespace tflite { 19 | 20 | // Defining a constexpr static class member is necessary in C++11 21 | constexpr int tflite::RuntimeShape::kMaxSmallSize; 22 | 23 | } // namespace tflite 24 | -------------------------------------------------------------------------------- /tensorflow/lite/core/api/error_reporter.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_CORE_API_ERROR_REPORTER_H_ 16 | #define TENSORFLOW_LITE_CORE_API_ERROR_REPORTER_H_ 17 | 18 | #include "tensorflow/compiler/mlir/lite/core/api/error_reporter.h" // IWYU pragma: export 19 | 20 | #endif // TENSORFLOW_LITE_CORE_API_ERROR_REPORTER_H_ 21 | -------------------------------------------------------------------------------- /tensorflow/lite/builtin_op_data.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | // Compatibility shim for new location of interface definitions. 16 | 17 | #ifndef TENSORFLOW_LITE_BUILTIN_OP_DATA_H_ 18 | #define TENSORFLOW_LITE_BUILTIN_OP_DATA_H_ 19 | 20 | #include "tensorflow/lite/core/c/builtin_op_data.h" 21 | 22 | #endif // TENSORFLOW_LITE_BUILTIN_OP_DATA_H_ 23 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/leaky_relu/leaky_relu11_input0_int16.csv: -------------------------------------------------------------------------------- 1 | 20213,5614,-9229,-24367,-24815,8282,29757,-13518,21571,5541,-32423,-15889,-29136,-10769,13030,-6505,26860,-32233,-10564,16027,875,2300,-16818,32232,3509,10757,25001,23820,30690,-24874,8014,-12463,-14774,-30087,5640,13573,7916,19665,-9651,-2567,-4902,-22324,-5408,10094,-27289,30974,28393,-7302,-6311,-4371,7867,1853,-6025,-21296,24416,-22533,-11225,-7080,-14143,17788,23667,12151,21192,2654,-18067,28290,-23852,17991,3369,-180,-28623,1759,8298,5477,28000,-31953,27589,2781,17693,-32495,-30889,-686,-19384,10568,-23606,-1684,-12674,18528,16323,24682,16386,28537,-27486,15723,16805,-18588,-8765,-25458,28417,-22725,13510,-30314,-23497,-9413,27605,-32152,31228,-8734,10249,6615,-28267,6018,-4570,9348,6863,-11941,-13198,407,17588,3932,-20752,21625,-2457,13478,917,-24961,-32381,-19956,28966,-3391,-3747,-8514,20985,30922,-25203,-32538,17244,12504,-15328,-23351,25350,-133,20600,1359,-14238,22601,-23420,-6720,27023,-20852,19841,19735,16428,3621,15693,6087,-19160,-22647,24443,-28763 2 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/pad/pad12_input0_int16.csv: -------------------------------------------------------------------------------- 1 | 26067,14984,-5472,-9512,12876,-6239,-9961,-3371,22856,-18807,16091,24720,7429,-264,3179,-10696,-27511,-18082,-7879,-24628,-9616,12279,14881,-893,-19414,21077,4992,-18021,-1891,2915,-8880,-5937,-32592,12888,-19669,-8536,-11198,19604,-20170,-25793,-13565,-14970,-28185,-12166,-10158,5341,-22049,-17716,16866,14742,10216,24102,13829,8556,30224,-16035,4054,-25065,-20626,10774,25201,-31170,4432,-2115,8228,-18397,-15228,-9808,-17559,31182,-13116,20711,32300,23961,-20976,-12044,17450,-3799,18583,-23141,-23398,31897,-6023,-21263,21773,-4900,7840,8700,22703,2539,28188,-28308,29542,7234,26884,27236,2407,-22748,9548,7030,-3713,-5598,-10363,-13769,-11584,-22360,-23956,10937,26835,-24558,26807,-16098,25800,12646,20255,-21197,17248,-17507,-22317,-23849,-28184,22534,-5918,7486,-3968,3994,21792,-30847,18245,3618,3986,27824,-1561,-23875,7126,-17728,-23569,-29974,-6109,-31354,-15792,6293,-7057,-2506,-3235,30591,-2343,6656,21078,1575,4785,-15004,21898,-18833,-16767,-1070,18555,-15119,-26492,31681 2 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/tools/benchmarking/show_meta_data.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2024 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | namespace tflite { 17 | 18 | #if !defined(GENERIC_BENCHMARK_NO_META_DATA) 19 | void GenericBenchmarkShowMetaData(); 20 | #else 21 | inline void GenericBenchmarkShowMetaData() {} 22 | #endif // defined(GENERIC_BENCHMARK_NO_META_DATA) 23 | 24 | } // namespace tflite 25 | -------------------------------------------------------------------------------- /tensorflow/lite/kernels/internal/optimized/neon_check.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_OPTIMIZED_NEON_CHECK_H_ 16 | #define TENSORFLOW_LITE_KERNELS_INTERNAL_OPTIMIZED_NEON_CHECK_H_ 17 | 18 | // TFLM does not need to utilize any Neon optimizations. 19 | 20 | #endif // TENSORFLOW_LITE_KERNELS_INTERNAL_OPTIMIZED_NEON_CHECK_H_ 21 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/arc_custom/system_setup.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "tensorflow/lite/micro/system_setup.h" 17 | 18 | #include 19 | 20 | namespace tflite { 21 | 22 | // Only the timer need to be reset for the custom arc platform 23 | void InitializeTarget() { _timer_default_reset(); } 24 | 25 | } // namespace tflite 26 | -------------------------------------------------------------------------------- /tensorflow/lite/c/builtin_op_data.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_C_BUILTIN_OP_DATA_H_ 16 | #define TENSORFLOW_LITE_C_BUILTIN_OP_DATA_H_ 17 | 18 | /// For documentation, see 19 | /// tensorflow/lite/core/c/builtin_op_data.h 20 | 21 | #include "tensorflow/lite/core/c/builtin_op_data.h" 22 | 23 | #endif // TENSORFLOW_LITE_C_BUILTIN_OP_DATA_H_ 24 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/conv/conv11_golden_int16.csv: -------------------------------------------------------------------------------- 1 | 32767,-32768,32767,-32768,-16957,-32768,-32768,-32768,-32768,32767,32767,32767,-32768,6140,32767,4972,32767,15964,-32768,-3224,30378,-23888,-25313,-11914,32767,27170,-26847,32767,-32768,-32768,-32768,32767,32767,-9071,32767,-32768,32767,-32768,-32768,1574,-32768,-32768,-32768,32767,-32768,32767,-31067,32767,30793,32767,832,32767,32767,32767,27246,-32768,32767,-32768,3982,32767,32767,32767,-32768,32767,-32768,-28891,11958,-32768,-32768,-32768,-32768,-32768,-32768,32767,-14462,32767,-32768,32767,-32768,32767,-10726,-32768,32767,25697,32767,32767,23130,17733,-32768,667,-32768,32767,-32768,20580,8052,7338,-20808,31365,28573,32767,2964,-32768,32767,32767,-1392,32767,-1974,-32768,-32768,-2024,32767,32767,32767,32767,17,32767,-23518,-32768,-32768,-19921,-32768,32767,6885,32767,-32768,32767,32767,32767,27071,-24545,32767,-6302,-32768,-32768,-15202,18007,32767,6866,20068,-32768,32767,32767,-32768,32767,9136,32767,-32768,32767,-10007,-32768,-32768,-32768,32767,32767,-23245,-32768,32767,32767,32767,32767 2 | -------------------------------------------------------------------------------- /third_party/flatbuffers/BUILD.system: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) # Apache 2.0 2 | 3 | filegroup( 4 | name = "LICENSE.txt", 5 | visibility = ["//visibility:public"], 6 | ) 7 | 8 | # Public flatc library to compile flatbuffer files at runtime. 9 | cc_library( 10 | name = "flatbuffers", 11 | linkopts = ["-lflatbuffers"], 12 | visibility = ["//visibility:public"], 13 | ) 14 | 15 | # Public flatc compiler library. 16 | cc_library( 17 | name = "flatc_library", 18 | linkopts = ["-lflatbuffers"], 19 | visibility = ["//visibility:public"], 20 | ) 21 | 22 | genrule( 23 | name = "lnflatc", 24 | outs = ["flatc.bin"], 25 | cmd = "ln -s $$(which flatc) $@", 26 | ) 27 | 28 | # Public flatc compiler. 29 | sh_binary( 30 | name = "flatc", 31 | srcs = ["flatc.bin"], 32 | visibility = ["//visibility:public"], 33 | ) 34 | 35 | cc_library( 36 | name = "runtime_cc", 37 | visibility = ["//visibility:public"], 38 | ) 39 | 40 | py_library( 41 | name = "runtime_py", 42 | visibility = ["//visibility:public"], 43 | ) 44 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/kernels/ethosu.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | // 17 | // This is a stub file for non-Ethos platforms 18 | // 19 | #include "tensorflow/lite/micro/micro_common.h" 20 | 21 | namespace tflite { 22 | 23 | TFLMRegistration* Register_ETHOSU() { return nullptr; } 24 | 25 | const char* GetString_ETHOSU() { return ""; } 26 | 27 | } // namespace tflite 28 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/tools/ci_build/test_bazel_with_compression.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2024 The TensorFlow Authors. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # ============================================================================== 16 | 17 | set -e 18 | set -x 19 | 20 | SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 21 | ROOT_DIR=${SCRIPT_DIR}/../../../../.. 22 | cd "${ROOT_DIR}" 23 | 24 | bazel test //... \ 25 | --//:with_compression \ 26 | --config=ci 27 | -------------------------------------------------------------------------------- /.github/workflows/run_ci.yml: -------------------------------------------------------------------------------- 1 | name: Run-CI 2 | 3 | # This is the entry point for ci.yml for scheduled and workflow_dispatch events. 4 | 5 | on: 6 | schedule: 7 | # 10am UTC is 3am or 4am PT depending on daylight savings. 8 | - cron: '0 10 * * *' 9 | 10 | # Allow manually triggering of the workflow. 11 | workflow_dispatch: {} 12 | 13 | jobs: 14 | call-ci: 15 | uses: ./.github/workflows/ci.yml 16 | if: | 17 | github.event_name == 'workflow_dispatch' || 18 | (github.event_name == 'schedule' && github.repository == 'tensorflow/tflite-micro') 19 | with: 20 | trigger-sha: ${{ github.sha }} 21 | 22 | issue-on-error: 23 | needs: [call-ci] 24 | if: ${{ always() && contains(needs.*.result, 'failure') }} 25 | uses: ./.github/workflows/issue_on_error.yml 26 | with: 27 | repo: ${{ github.repository }} 28 | workflow: ${{ github.workflow }} 29 | run_id: ${{ github.run_id }} 30 | run_number: ${{ github.run_number }} 31 | flag_label: ci:bot_issue 32 | secrets: 33 | token: ${{ secrets.GITHUB_TOKEN }} -------------------------------------------------------------------------------- /tensorflow/lite/micro/kernels/circular_buffer_flexbuffers_generated_data.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_LITE_MICRO_KERNELS_FLEXBUFFERS_GENERATED_DATA_H 17 | #define TENSORFLOW_LITE_MICRO_KERNELS_FLEXBUFFERS_GENERATED_DATA_H 18 | 19 | extern const int g_gen_data_size_circular_buffer_config; 20 | extern const unsigned char g_gen_data_circular_buffer_config[]; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /tensorflow/lite/c/c_api_types.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_C_C_API_TYPES_H_ 16 | #define TENSORFLOW_LITE_C_C_API_TYPES_H_ 17 | 18 | /// \file 19 | /// 20 | /// C API types for TensorFlow Lite. 21 | /// 22 | /// For documentation, see tensorflow/lite/core/c/c_api_types.h 23 | 24 | #include "tensorflow/lite/core/c/c_api_types.h" 25 | 26 | #endif // TENSORFLOW_LITE_C_C_API_TYPES_H_ 27 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/kernels/reshape.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "tensorflow/lite/c/builtin_op_data.h" 17 | #include "tensorflow/lite/c/common.h" 18 | 19 | namespace tflite { 20 | 21 | constexpr int kReshapeInputTensor = 0; 22 | constexpr int kReshapeOutputTensor = 0; 23 | 24 | TfLiteStatus PrepareReshapeReference(TfLiteContext* context, TfLiteNode* node); 25 | 26 | } // namespace tflite 27 | -------------------------------------------------------------------------------- /signal/src/complex.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef SIGNAL_SRC_COMPLEX_H_ 17 | #define SIGNAL_SRC_COMPLEX_H_ 18 | 19 | #include 20 | 21 | // We would use the standard complex type in complex.h, but there's 22 | // no guarantee that all architectures will support it. 23 | template 24 | struct Complex { 25 | T real; 26 | T imag; 27 | }; 28 | 29 | #endif // SIGNAL_SRC_COMPLEX_H_ 30 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/kernels/ceva/ceva_common.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_LITE_MICRO_KERNELS_CEVA_CEVA_COMMON_H_ 17 | #define TENSORFLOW_LITE_MICRO_KERNELS_CEVA_CEVA_COMMON_H_ 18 | 19 | #if defined(CEVA_BX1) || defined(CEVA_SP500) 20 | extern int32_t CEVA_TFLM_KERNELS_SCRATCH[]; 21 | extern int32_t CEVA_TFLM_KERNELS_SCRATCH_SIZE_VAL; 22 | #endif 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/recipes/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_python//python:defs.bzl", "py_library", "py_test") 2 | load("@tflm_pip_deps//:requirements.bzl", "requirement") 3 | 4 | package( 5 | licenses = ["notice"], 6 | ) 7 | 8 | py_library( 9 | name = "add_four_numbers", 10 | srcs = ["add_four_numbers.py"], 11 | visibility = ["//:__subpackages__"], 12 | deps = [ 13 | requirement("numpy"), 14 | requirement("tensorflow-cpu"), 15 | ], 16 | ) 17 | 18 | py_library( 19 | name = "resource_variables_lib", 20 | srcs = ["resource_variables_lib.py"], 21 | visibility = ["//:__subpackages__"], 22 | deps = [ 23 | requirement("numpy"), 24 | requirement("tensorflow-cpu"), 25 | ], 26 | ) 27 | 28 | py_test( 29 | name = "resource_variables_test", 30 | srcs = ["resource_variables_test.py"], 31 | tags = [ 32 | "noasan", 33 | "nomsan", # Python doesn't like these symbols 34 | "noubsan", 35 | ], 36 | deps = [ 37 | ":resource_variables_lib", 38 | "//python/tflite_micro:runtime", 39 | ], 40 | ) 41 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/testing/bluepill_nontest.resc: -------------------------------------------------------------------------------- 1 | # Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # ============================================================================== 15 | 16 | mach create 17 | # Load platform specification 18 | machine LoadPlatformDescription @platforms/cpus/stm32f103.repl 19 | # Create additional semihosting interface peripheral 20 | machine LoadPlatformDescriptionFromString "uartSemihosting: UART.SemihostingUart @ cpu" 21 | showAnalyzer sysbus.cpu.uartSemihosting 22 | 23 | -------------------------------------------------------------------------------- /codegen/examples/hello_world/hello_world.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "codegen/examples/hello_world/hello_world_model.h" 17 | #include "tensorflow/lite/c/c_api_types.h" 18 | 19 | int main(int argc, char** argv) { 20 | hello_world_model::Model hello_world{}; 21 | 22 | TfLiteStatus status = hello_world.Invoke(); 23 | if (status != kTfLiteOk) { 24 | return -1; 25 | } 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/kernels/ethosu.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_MICRO_KERNELS_ETHOSU_H_ 16 | #define TENSORFLOW_LITE_MICRO_KERNELS_ETHOSU_H_ 17 | 18 | #include "tensorflow/lite/c/common.h" 19 | 20 | namespace tflite { 21 | 22 | TFLMRegistration* Register_ETHOSU(); 23 | 24 | const char* GetString_ETHOSU(); 25 | 26 | } // namespace tflite 27 | 28 | #endif // TENSORFLOW_LITE_MICRO_KERNELS_ETHOSU_H_ 29 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/tools/ci_build/test_bazel_asan.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2019 The TensorFlow Authors. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # ============================================================================== 16 | 17 | set -e 18 | set -x 19 | 20 | SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 21 | ROOT_DIR=${SCRIPT_DIR}/../../../../.. 22 | cd "${ROOT_DIR}" 23 | 24 | bazel test //... \ 25 | --config=ci \ 26 | --config=asan \ 27 | --build_tag_filters=-noasan \ 28 | --test_tag_filters=-noasan 29 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/tools/ci_build/test_bazel_msan.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2019 The TensorFlow Authors. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # ============================================================================== 16 | 17 | set -e 18 | set -x 19 | 20 | SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 21 | ROOT_DIR=${SCRIPT_DIR}/../../../../.. 22 | cd "${ROOT_DIR}" 23 | 24 | bazel test //... \ 25 | --config=ci \ 26 | --config=msan \ 27 | --build_tag_filters=-nomsan \ 28 | --test_tag_filters=-nomsan 29 | -------------------------------------------------------------------------------- /.github/workflows/stale_handler.yml: -------------------------------------------------------------------------------- 1 | name: 'Stale Handler' 2 | on: 3 | schedule: 4 | - cron: '0 10 * * *' 5 | 6 | workflow_dispatch: {} 7 | 8 | jobs: 9 | stale: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/stale@v7 13 | with: 14 | stale-issue-message: > 15 | "This issue is being marked as stale due to inactivity. Remove label or 16 | comment to prevent closure in 5 days." 17 | stale-pr-message: > 18 | "This PR is being marked as stale due to inactivity. Remove label or 19 | comment to prevent closure in 5 days." 20 | close-issue-message: > 21 | "This issue is being closed because it has been marked as 22 | stale for 5 days with no further activity." 23 | close-pr-message: > 24 | "This PR is being closed because it has been marked as 25 | stale for 5 days with no further activity." 26 | days-before-issue-stale: 25 27 | days-before-issue-close: 5 28 | days-before-pr-stale: 40 29 | days-before-pr-close: 5 30 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/testing/Dockerfile.riscv: -------------------------------------------------------------------------------- 1 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # ============================================================================== 15 | 16 | # This docker configuration file lets you emulate a Hifive1 board 17 | # on an x86 desktop or laptop, which can be useful for debugging and 18 | # automated testing. 19 | FROM antmicro/renode:latest 20 | 21 | LABEL maintainer="Pete Warden " 22 | 23 | RUN apt-get update 24 | RUN apt-get install -y curl git unzip make g++ -------------------------------------------------------------------------------- /tensorflow/lite/micro/system_setup.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "tensorflow/lite/micro/system_setup.h" 17 | 18 | namespace tflite { 19 | 20 | // To add an equivalent function for your own platform, create your own 21 | // implementation file, and place it in a subfolder named after the target. See 22 | // tensorflow/lite/micro/debug_log.cc for a similar example. 23 | void InitializeTarget() {} 24 | 25 | } // namespace tflite 26 | -------------------------------------------------------------------------------- /.github/workflows/riscv_postmerge.yml: -------------------------------------------------------------------------------- 1 | # YAML schema for GitHub Actions: 2 | # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions 3 | # 4 | # Helpful YAML parser to clarify YAML syntax: 5 | # https://yaml-online-parser.appspot.com/ 6 | # 7 | # This file can not be run stand-alone. It is called from tests_post.yml as part of 8 | # the ci automation. 9 | 10 | name: RISC-V Postmerge 11 | 12 | on: 13 | workflow_call: 14 | inputs: 15 | trigger-sha: 16 | required: true 17 | type: string 18 | secrets: 19 | tflm-bot-token: 20 | required: true 21 | 22 | jobs: 23 | riscv_postmerge: 24 | runs-on: ubuntu-latest 25 | 26 | name: RISC-V Tests (postmerge) 27 | steps: 28 | - uses: actions/setup-python@v4 29 | with: 30 | python-version: '3.10' 31 | - uses: actions/checkout@v3 32 | with: 33 | ref: ${{ inputs.trigger-sha }} 34 | - name: Test 35 | uses: docker://ghcr.io/tflm-bot/tflm-ci:0.6.5 36 | with: 37 | args: /bin/sh -c tensorflow/lite/micro/tools/ci_build/test_riscv.sh 38 | -------------------------------------------------------------------------------- /codegen/operators/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_python//python:defs.bzl", "py_library") 2 | 3 | package( 4 | default_visibility = ["//:__subpackages__"], 5 | licenses = ["notice"], 6 | ) 7 | 8 | py_library( 9 | name = "constants", 10 | srcs = [ 11 | "constants.py", 12 | ], 13 | deps = [ 14 | "//tensorflow/lite/python:schema_py", 15 | ], 16 | ) 17 | 18 | py_library( 19 | name = "factory", 20 | srcs = [ 21 | "factory.py", 22 | ], 23 | deps = [ 24 | ":fully_connected", 25 | ":operator", 26 | "//tensorflow/lite/python:schema_py", 27 | ], 28 | ) 29 | 30 | py_library( 31 | name = "fully_connected", 32 | srcs = [ 33 | "fully_connected.py", 34 | ], 35 | deps = [ 36 | ":constants", 37 | ":operator", 38 | "//codegen:utils", 39 | "//tensorflow/lite/python:schema_py", 40 | ], 41 | ) 42 | 43 | py_library( 44 | name = "operator", 45 | srcs = [ 46 | "operator.py", 47 | ], 48 | deps = [ 49 | "//codegen:utils", 50 | "//tensorflow/lite/python:schema_py", 51 | ], 52 | ) 53 | -------------------------------------------------------------------------------- /signal/micro/kernels/fft_auto_scale_kernel.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef SIGNAL_MICRO_KERNELS_FFT_AUTO_SCALE_KERNEL_H_ 16 | #define SIGNAL_MICRO_KERNELS_FFT_AUTO_SCALE_KERNEL_H_ 17 | 18 | #include "tensorflow/lite/c/common.h" 19 | 20 | namespace tflite { 21 | 22 | TfLiteStatus FftAutoScalePrepare(TfLiteContext* context, TfLiteNode* node); 23 | 24 | } // namespace tflite 25 | 26 | #endif // SIGNAL_MICRO_KERNELS_FFT_AUTO_SCALE_KERNEL_H_ 27 | -------------------------------------------------------------------------------- /tensorflow/compiler/mlir/lite/kernels/internal/compatibility_macros.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2024 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_COMPILER_MLIR_LITE_KERNELS_INTERNAL_COMPATABILITY_MACROS_H_ 17 | #define TENSORFLOW_COMPILER_MLIR_LITE_KERNELS_INTERNAL_COMPATABILITY_MACROS_H_ 18 | 19 | #include "tensorflow/lite/kernels/internal/compatibility.h" // IWYU pragma: keep 20 | 21 | #endif // TENSORFLOW_COMPILER_MLIR_LITE_KERNELS_INTERNAL_COMPATABILITY_MACROS_H_ 22 | -------------------------------------------------------------------------------- /tensorflow/lite/experimental/microfrontend/lib/log_scale_io.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2018 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #include "tensorflow/lite/experimental/microfrontend/lib/log_scale_io.h" 16 | 17 | void LogScaleWriteMemmap(FILE* fp, const struct LogScaleState* state, 18 | const char* variable) { 19 | fprintf(fp, "%s->enable_log = %d;\n", variable, state->enable_log); 20 | fprintf(fp, "%s->scale_shift = %d;\n", variable, state->scale_shift); 21 | } 22 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/person_detection/utils/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test") 2 | load("@tflm_pip_deps//:requirements.bzl", "requirement") 3 | 4 | package( 5 | features = ["-layering_check"], 6 | licenses = ["notice"], 7 | ) 8 | 9 | py_binary( 10 | name = "raw_to_bitmap", 11 | srcs = ["raw_to_bitmap.py"], 12 | deps = [ 13 | requirement("numpy"), 14 | ], 15 | ) 16 | 17 | py_library( 18 | name = "raw_to_bitmap_lib", 19 | srcs = ["raw_to_bitmap.py"], 20 | deps = [ 21 | requirement("numpy"), 22 | ], 23 | ) 24 | 25 | py_test( 26 | name = "raw_to_bitmap_test", 27 | srcs = ["raw_to_bitmap_test.py"], 28 | data = glob(["testdata/**"]), 29 | tags = [ 30 | "nomicro_static", # TF dep incompatible w/ TF_LITE_STATIC_MEMORY. 31 | "notap", # TODO(b/186679612) 32 | "noubsan", # TODO(b/144512025): Fix raw_to_bitmap_test to fix ubsan failure. 33 | ], 34 | deps = [ 35 | ":raw_to_bitmap_lib", 36 | requirement("tensorflow-cpu"), 37 | requirement("numpy"), 38 | ], 39 | ) 40 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/kernels/ceva/ceva_common.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "tensorflow/lite/micro/kernels/ceva/ceva_tflm_lib.h" 17 | #define CEVA_TFLM_KERNELS_SCRATCH_SIZE_VAL_DEF 32768 18 | int32_t CEVA_TFLM_KERNELS_SCRATCH_SIZE_VAL = 19 | CEVA_TFLM_KERNELS_SCRATCH_SIZE_VAL_DEF; 20 | #ifndef WIN32 21 | __attribute__((section(".MODEL_DATA"))) 22 | #endif 23 | int32_t CEVA_TFLM_KERNELS_SCRATCH[CEVA_TFLM_KERNELS_SCRATCH_SIZE_VAL_DEF]; 24 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/testing/test_conv_model.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_LITE_MICRO_TESTING_TEST_CONV_MODEL_H_ 17 | #define TENSORFLOW_LITE_MICRO_TESTING_TEST_CONV_MODEL_H_ 18 | 19 | // See generate_test_models.py for updating the contents of this model: 20 | extern const unsigned char kTestConvModelData[]; 21 | extern const unsigned int kTestConvModelDataSize; 22 | 23 | #endif // TENSORFLOW_LITE_MICRO_TESTING_TEST_CONV_MODEL_H_ 24 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/compression/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 The TensorFlow Authors. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | """TensorFlow Lite for Microcontrollers compression module.""" 15 | 16 | # This __init__.py file exists to make compression features available as part 17 | # of the tflite_micro Python package. 18 | # 19 | # Usage example: 20 | # from tflite_micro import compression 21 | # ... 22 | 23 | from .compress import compress 24 | from .spec import parse_yaml 25 | from .spec_builder import SpecBuilder 26 | 27 | __all__ = ["compress", "parse_yaml", "SpecBuilder"] 28 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/python/interpreter/src/python_ops_resolver.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_MICRO_PYTHON_INTERPRETER_SRC_PYTHON_OPS_RESOLVER_H_ 16 | #define TENSORFLOW_LITE_MICRO_PYTHON_INTERPRETER_SRC_PYTHON_OPS_RESOLVER_H_ 17 | 18 | // TODO(b/286456378): remove once this shim is no longer needed. 19 | #include "python/tflite_micro/python_ops_resolver.h" 20 | 21 | #endif // TENSORFLOW_LITE_MICRO_PYTHON_INTERPRETER_SRC_PYTHON_OPS_RESOLVER_H_ 22 | -------------------------------------------------------------------------------- /tensorflow/extra_rules.bzl: -------------------------------------------------------------------------------- 1 | def tflm_kernel_friends(): 2 | return [] 3 | 4 | def tflm_audio_frontend_friends(): 5 | return [] 6 | 7 | def tflm_application_friends(): 8 | return [] 9 | 10 | def tflm_signal_friends(): 11 | return [] 12 | 13 | def tflm_python_op_resolver_friends(): 14 | return [] 15 | 16 | def xtensa_fusion_f1_config(): 17 | """Config setting for all Fusion F1 based cores.""" 18 | return "//tensorflow/lite/micro/kernels:xtensa_fusion_f1_default" 19 | 20 | def xtensa_hifi_3_config(): 21 | """Config setting for all HiFi 3 based cores.""" 22 | return "//tensorflow/lite/micro/kernels:xtensa_hifi_3_default" 23 | 24 | def xtensa_hifi_3z_config(): 25 | """Config setting for all HiFi 3z based cores.""" 26 | return "//tensorflow/lite/micro/kernels:xtensa_hifi_3z_default" 27 | 28 | def xtensa_hifi_5_config(): 29 | """Config setting for all HiFi 5 based cores.""" 30 | return "//tensorflow/lite/micro/kernels:xtensa_hifi_5_default" 31 | 32 | def xtensa_vision_p6_config(): 33 | """Config setting for all Vision P6 based cores.""" 34 | return "//tensorflow/lite/micro/kernels:xtensa_vision_p6_default" 35 | -------------------------------------------------------------------------------- /tensorflow/lite/core/api/tensor_utils.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_LITE_CORE_API_TENSOR_UTILS_H_ 17 | #define TENSORFLOW_LITE_CORE_API_TENSOR_UTILS_H_ 18 | 19 | #include "tensorflow/lite/core/c/common.h" 20 | 21 | namespace tflite { 22 | 23 | // Resets a variable tensor to the default value. 24 | TfLiteStatus ResetVariableTensor(TfLiteTensor* tensor); 25 | 26 | } // namespace tflite 27 | 28 | #endif // TENSORFLOW_LITE_CORE_API_TENSOR_UTILS_H_ 29 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/integration_tests/seanet/pad/pad12_golden_int16.csv: -------------------------------------------------------------------------------- 1 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26067,14984,-5472,-9512,12876,-6239,-9961,-3371,22856,-18807,16091,24720,7429,-264,3179,-10696,-27511,-18082,-7879,-24628,-9616,12279,14881,-893,-19414,21077,4992,-18021,-1891,2915,-8880,-5937,-32592,12888,-19669,-8536,-11198,19604,-20170,-25793,-13565,-14970,-28185,-12166,-10158,5341,-22049,-17716,16866,14742,10216,24102,13829,8556,30224,-16035,4054,-25065,-20626,10774,25201,-31170,4432,-2115,8228,-18397,-15228,-9808,-17559,31182,-13116,20711,32300,23961,-20976,-12044,17450,-3799,18583,-23141,-23398,31897,-6023,-21263,21773,-4900,7840,8700,22703,2539,28188,-28308,29542,7234,26884,27236,2407,-22748,9548,7030,-3713,-5598,-10363,-13769,-11584,-22360,-23956,10937,26835,-24558,26807,-16098,25800,12646,20255,-21197,17248,-17507,-22317,-23849,-28184,22534,-5918,7486,-3968,3994,21792,-30847,18245,3618,3986,27824,-1561,-23875,7126,-17728,-23569,-29974,-6109,-31354,-15792,6293,-7057,-2506,-3235,30591,-2343,6656,21078,1575,4785,-15004,21898,-18833,-16767,-1070,18555,-15119,-26492,31681,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 2 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/tools/ci_build/test_bazel_with_compression_asan.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2024 The TensorFlow Authors. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # ============================================================================== 16 | 17 | set -e 18 | set -x 19 | 20 | SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 21 | ROOT_DIR=${SCRIPT_DIR}/../../../../.. 22 | cd "${ROOT_DIR}" 23 | 24 | bazel test //... \ 25 | --//:with_compression \ 26 | --config=ci \ 27 | --config=asan \ 28 | --build_tag_filters=-noasan \ 29 | --test_tag_filters=-noasan 30 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/tools/ci_build/test_bazel_with_compression_msan.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2024 The TensorFlow Authors. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # ============================================================================== 16 | 17 | set -e 18 | set -x 19 | 20 | SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 21 | ROOT_DIR=${SCRIPT_DIR}/../../../../.. 22 | cd "${ROOT_DIR}" 23 | 24 | bazel test //... \ 25 | --//:with_compression \ 26 | --config=ci \ 27 | --config=msan \ 28 | --build_tag_filters=-nomsan \ 29 | --test_tag_filters=-nomsan 30 | -------------------------------------------------------------------------------- /third_party/xtensa/examples/pytorch_to_tflite/Makefile.inc: -------------------------------------------------------------------------------- 1 | ifeq ($(OPTIMIZED_KERNEL_DIR), xtensa) 2 | EXAMPLE_NAME:=pytorch_to_tflite 3 | PYTORCH_TO_TFLITE_TEST_SRCS := \ 4 | $(TENSORFLOW_ROOT)third_party/xtensa/examples/$(EXAMPLE_NAME)/$(EXAMPLE_NAME)_test.cc \ 5 | $(TENSORFLOW_ROOT)third_party/xtensa/examples/$(EXAMPLE_NAME)/pytorch_images_dog_jpg.cc \ 6 | $(TENSORFLOW_ROOT)third_party/xtensa/examples/pytorch_to_tflite/pytorch_op_resolver.cc \ 7 | 8 | PYTORCH_TO_TFLITE_GENERATOR_INPUTS := \ 9 | $(TENSORFLOW_ROOT)third_party/xtensa/examples/pytorch_to_tflite/mobilenet_v2_quantized_1x3x224x224.tflite 10 | 11 | PYTORCH_TO_TFLITE_HDRS := \ 12 | $(TENSORFLOW_ROOT)third_party/xtensa/examples/$(EXAMPLE_NAME)/pytorch_images_dog_jpg.h \ 13 | $(TENSORFLOW_ROOT)third_party/xtensa/examples/pytorch_to_tflite/pytorch_op_resolver.h \ 14 | 15 | 16 | ## Tests loading and running a mobilenet v2 model. 17 | ifneq ($(TARGET_ARCH), hifi5) 18 | $(eval $(call microlite_test,pytorch_to_tflite_test,\ 19 | $(PYTORCH_TO_TFLITE_TEST_SRCS),$(PYTORCH_TO_TFLITE_HDRS),$(PYTORCH_TO_TFLITE_GENERATOR_INPUTS))) 20 | endif 21 | endif 22 | 23 | -------------------------------------------------------------------------------- /ci/install_cores_xplorer_13.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | mkdir /opt/xtensa/licenses 4 | 5 | ############## 6 | # Fusion F1 7 | ############## 8 | cd /opt/xtensa/ 9 | tar xvzf F1_190305_swupgrade_linux.tgz --dir /opt/xtensa/licenses/ 10 | cd /opt/xtensa/licenses/RI-2020.4-linux/F1_190305_swupgrade/ 11 | 12 | ./install --xtensa-tools \ 13 | /opt/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/ \ 14 | --no-default \ 15 | --no-replace 16 | 17 | ############## 18 | # Vision P6 19 | ############## 20 | cd /opt/xtensa/ 21 | tar xvzf P6_200528_linux.tgz --dir /opt/xtensa/licenses/ 22 | cd /opt/xtensa/licenses/RI-2020.4-linux/P6_200528/ 23 | 24 | ./install --xtensa-tools \ 25 | /opt/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/ \ 26 | --no-default \ 27 | --no-replace 28 | 29 | ############## 30 | # Hifi3Z 31 | ############## 32 | cd /opt/xtensa/ 33 | tar xvzf HIFI_190304_swupgrade_linux.tgz --dir /opt/xtensa/licenses/ 34 | cd /opt/xtensa/licenses/RI-2020.4-linux/HIFI_190304_swupgrade/ 35 | 36 | ./install --xtensa-tools \ 37 | /opt/xtensa/XtDevTools/install/tools/RI-2020.4-linux/XtensaTools/ \ 38 | --no-default \ 39 | --no-replace 40 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/cortex_m_corstone_300/micro_time.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | // This file is empty to ensure that a specialized implementation of 16 | // micro_time.h is used (instead of the default implementation from 17 | // tensorflow/lite/micro/micro_time.cc). 18 | // 19 | // The actual target-specific implementation of micro_time.h is in 20 | // system_setup.cc since that allows us to consolidate all the target-specific 21 | // specializations into one source file. 22 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/hexagon/micro_time.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | // This file is empty to ensure that a specialized implementation of 16 | // micro_time.h is used (instead of the default implementation from 17 | // tensorflow/lite/micro/micro_time.cc). 18 | // 19 | // The actual target-specific implementation of micro_time.h is in 20 | // system_setup.cc since that allows us to consolidate all the target-specific 21 | // specializations into one source file. 22 | // 23 | // 24 | -------------------------------------------------------------------------------- /tensorflow/lite/schema/BUILD: -------------------------------------------------------------------------------- 1 | load("@flatbuffers//:build_defs.bzl", "flatbuffer_cc_library") 2 | load("@rules_cc//cc:cc_library.bzl", "cc_library") 3 | 4 | package( 5 | default_visibility = [ 6 | "//visibility:public", 7 | ], 8 | licenses = ["notice"], 9 | ) 10 | 11 | # Note: when wanting to generate the schema_generated.h, you must build as: 12 | # bazel build schema_fbs_srcs. 13 | flatbuffer_cc_library( 14 | name = "schema_fbs", 15 | srcs = ["//tensorflow/compiler/mlir/lite/schema:schema.fbs"], 16 | ) 17 | 18 | # Generic schema for inference on device (but with reflections makes bigger). 19 | flatbuffer_cc_library( 20 | name = "schema_fbs_with_reflection", 21 | srcs = ["//tensorflow/compiler/mlir/lite/schema:schema.fbs"], 22 | flatc_args = [ 23 | "--reflect-types", 24 | "--reflect-names", 25 | "--no-union-value-namespacing", 26 | "--gen-object-api", 27 | ], 28 | out_prefix = "reflection/", 29 | ) 30 | 31 | cc_library( 32 | name = "schema_utils", 33 | hdrs = ["schema_utils.h"], 34 | deps = [ 35 | "//tensorflow/compiler/mlir/lite/schema:schema_utils", 36 | ], 37 | ) 38 | -------------------------------------------------------------------------------- /tensorflow/compiler/mlir/lite/schema/BUILD: -------------------------------------------------------------------------------- 1 | load("@flatbuffers//:build_defs.bzl", "flatbuffer_cc_library") 2 | load("@rules_cc//cc:cc_library.bzl", "cc_library") 3 | 4 | package( 5 | default_visibility = [ 6 | "//visibility:public", 7 | ], 8 | licenses = ["notice"], 9 | ) 10 | 11 | exports_files( 12 | srcs = ["schema.fbs"], 13 | ) 14 | 15 | flatbuffer_cc_library( 16 | name = "schema_fbs", 17 | srcs = ["schema.fbs"], 18 | ) 19 | 20 | # Generic schema for inference on device (but with reflections makes bigger). 21 | flatbuffer_cc_library( 22 | name = "schema_fbs_with_reflection", 23 | srcs = ["schema.fbs"], 24 | flatc_args = [ 25 | "--reflect-types", 26 | "--reflect-names", 27 | "--no-union-value-namespacing", 28 | "--gen-object-api", 29 | ], 30 | out_prefix = "reflection/", 31 | ) 32 | 33 | cc_library( 34 | name = "schema_utils", 35 | srcs = ["schema_utils.cc"], 36 | hdrs = ["schema_utils.h"], 37 | deps = [ 38 | ":schema_fbs", 39 | "//tensorflow/compiler/mlir/lite/kernels/internal:compatibility_macros", 40 | "@flatbuffers//:runtime_cc", 41 | ], 42 | ) 43 | -------------------------------------------------------------------------------- /signal/src/log.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef SIGNAL_SRC_LOG_H_ 17 | #define SIGNAL_SRC_LOG_H_ 18 | 19 | #include 20 | 21 | namespace tflite { 22 | namespace tflm_signal { 23 | // TODO(b/286250473): remove namespace once de-duped libraries above 24 | 25 | // Natural logarithm of an integer. The result is multiplied by out_scale 26 | uint32_t Log32(uint32_t x, uint32_t out_scale); 27 | 28 | } // namespace tflm_signal 29 | } // namespace tflite 30 | #endif // SIGNAL_SRC_LOG_H_ 31 | -------------------------------------------------------------------------------- /signal/src/square_root.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef SIGNAL_SRC_SQUARE_ROOT_H_ 17 | #define SIGNAL_SRC_SQUARE_ROOT_H_ 18 | 19 | #include 20 | 21 | namespace tflite { 22 | namespace tflm_signal { 23 | // TODO(b/286250473): remove namespace once de-duped libraries above 24 | 25 | // Square root 26 | uint16_t Sqrt32(uint32_t num); 27 | uint32_t Sqrt64(uint64_t num); 28 | 29 | } // namespace tflm_signal 30 | } // namespace tflite 31 | 32 | #endif // SIGNAL_SRC_SQUARE_ROOT_H_ 33 | -------------------------------------------------------------------------------- /tensorflow/compiler/mlir/lite/schema/schema_generated.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2024 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_COMPILER_MLIR_LITE_SCHEMA_SCHEMA_GENERATED_H_ 16 | #define TENSORFLOW_COMPILER_MLIR_LITE_SCHEMA_SCHEMA_GENERATED_H_ 17 | 18 | // This file should only be used by the make build to redirect schema_utils.cc 19 | // usage of the generated schema to the proper location. 20 | #include "tensorflow/lite/schema/schema_generated.h" // IWYU pragma: keep 21 | 22 | #endif // TENSORFLOW_LITE_SCHEMA_SCHEMA_UTILS_H_ 23 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/kernels/detection_postprocess_flexbuffers_generated_data.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_LITE_MICRO_KERNELS_FLEXBUFFERS_GENERATED_DATA_H 17 | #define TENSORFLOW_LITE_MICRO_KERNELS_FLEXBUFFERS_GENERATED_DATA_H 18 | 19 | extern const int g_gen_data_size_none_regular_nms; 20 | extern const unsigned char g_gen_data_none_regular_nms[]; 21 | 22 | extern const int g_gen_data_size_regular_nms; 23 | extern const unsigned char g_gen_data_regular_nms[]; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /.github/workflows/run_hexagon.yml: -------------------------------------------------------------------------------- 1 | name: Run-Hexagon 2 | 3 | # This is the entry point for hexagon.yml for scheduled and workflow_dispatch events. 4 | 5 | on: 6 | schedule: 7 | # 10am UTC is 3am or 4am PT depending on daylight savings. 8 | - cron: '0 10 * * *' 9 | 10 | # Allow manually triggering of the workflow. 11 | workflow_dispatch: {} 12 | 13 | jobs: 14 | call-hexagon: 15 | uses: ./.github/workflows/hexagon.yml 16 | if: | 17 | github.event_name == 'workflow_dispatch' || 18 | (github.event_name == 'schedule' && github.repository == 'tensorflow/tflite-micro') 19 | with: 20 | trigger-sha: ${{ github.sha }} 21 | secrets: 22 | tflm-bot-token: ${{ secrets.TFLM_BOT_PACKAGE_READ_TOKEN }} 23 | 24 | issue-on-error: 25 | needs: [call-hexagon] 26 | if: ${{ always() && contains(needs.*.result, 'failure') }} 27 | uses: ./.github/workflows/issue_on_error.yml 28 | with: 29 | repo: ${{ github.repository }} 30 | workflow: ${{ github.workflow }} 31 | run_id: ${{ github.run_id }} 32 | run_number: ${{ github.run_number }} 33 | flag_label: ci:bot_issue 34 | secrets: 35 | token: ${{ secrets.GITHUB_TOKEN }} -------------------------------------------------------------------------------- /signal/micro/kernels/filter_bank_square_root.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef SIGNAL_MICRO_KERNELS_FILTER_BANK_SQUARE_ROOT_H_ 16 | #define SIGNAL_MICRO_KERNELS_FILTER_BANK_SQUARE_ROOT_H_ 17 | 18 | #include "tensorflow/lite/c/common.h" 19 | 20 | namespace tflite { 21 | 22 | TfLiteStatus FilterBankSquareRootPrepare(TfLiteContext* context, 23 | TfLiteNode* node); 24 | 25 | } // namespace tflite 26 | 27 | #endif // SIGNAL_MICRO_KERNELS_FILTER_BANK_SQUARE_ROOT_H_ 28 | -------------------------------------------------------------------------------- /signal/micro/kernels/delay_flexbuffers_generated_data.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef SIGNAL_MICRO_KERNELS_DELAY_FLEXBUFFERS_GENERATED_DATA_H_ 17 | #define SIGNAL_MICRO_KERNELS_DELAY_FLEXBUFFERS_GENERATED_DATA_H_ 18 | 19 | extern const int g_gen_data_size_3_delay; 20 | extern const unsigned char g_gen_data_3_delay[]; 21 | 22 | extern const int g_gen_data_size_5_delay; 23 | extern const unsigned char g_gen_data_5_delay[]; 24 | 25 | #endif // SIGNAL_MICRO_KERNELS_DELAY_FLEXBUFFERS_GENERATED_DATA_H_ 26 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/python/tflite_size/README.md: -------------------------------------------------------------------------------- 1 | This is a experimental tool to generate a visualization of tflite file with size info for 2 | each field. 3 | 4 | The size info of each field is the raw storage size info of each field without 5 | any flatbuffer overhead such as the offset table etc. Hence, the size info 6 | provide a lower bound on the size of data required (such as storing it into a c 7 | struct) instead of storing it as the tflite buffer. 8 | 9 | Here is how you can use a visualization of tflite file 10 | 11 | ``` 12 | cd tensorflow/lite/micro/python/tflite_size/src 13 | 14 | bazel run flatbuffer_size -- in_tflite_file out_html_file 15 | ``` 16 | 17 | A sample output html looks like this ![sample_output](./sample_output.png). 18 | 19 | It displays each field's name, value and size. The display is composed of 20 | collapsibly list so that you can zoom in/out individual structure based on need. 21 | 22 | ## How to update `schema_generated_with_reflective_type.h` 23 | 24 | We generate our own schema_generated_with_reflective, using the build target in 25 | tensorflow/lite/schema:schema_fbs_with_reflection (call with: 26 | bazel build schema_fbs_with_reflection_srcs). 27 | 28 | -------------------------------------------------------------------------------- /third_party/xtensa/nnlib_hifi4/nnlib_hifi4.BUILD: -------------------------------------------------------------------------------- 1 | constraint_setting( 2 | name = "compatible_constraint", 3 | ) 4 | 5 | # Set this constraint_value on your platform to indicate compatiblity with this 6 | # library. 7 | constraint_value( 8 | name = "compatible", 9 | constraint_setting = ":compatible_constraint", 10 | visibility = [ 11 | "//visibility:public", 12 | ], 13 | ) 14 | 15 | cc_library( 16 | name = "lib", 17 | srcs = glob(["xa_nnlib/algo/**/*.c"]), 18 | hdrs = glob([ 19 | "xa_nnlib/algo/**/*.h", 20 | "xa_nnlib/include/**/*.h", 21 | ]), 22 | copts = ["-Wno-unused-parameter"], 23 | defines = [ 24 | "NNLIB_V2=1", 25 | "MODEL_INT16=1", 26 | "EIGEN_NO_MALLOC=1", 27 | "hifi4=1", 28 | ], 29 | includes = [ 30 | "xa_nnlib", 31 | "xa_nnlib/algo/common/include", 32 | "xa_nnlib/algo/kernels", 33 | "xa_nnlib/algo/ndsp/hifi4/include", 34 | "xa_nnlib/include", 35 | "xa_nnlib/include/nnlib", 36 | ], 37 | target_compatible_with = [ 38 | ":compatible", 39 | ], 40 | visibility = [ 41 | "//visibility:public", 42 | ], 43 | ) 44 | -------------------------------------------------------------------------------- /signal/src/max_abs.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef SIGNAL_SRC_MAX_ABS_H_ 17 | #define SIGNAL_SRC_MAX_ABS_H_ 18 | 19 | #include 20 | 21 | // TODO(b/286250473): remove namespace once de-duped libraries 22 | namespace tflite { 23 | namespace tflm_signal { 24 | 25 | // Returns the maximum absolute value of the `size` elements in `input` 26 | int16_t MaxAbs16(const int16_t* input, int size); 27 | 28 | } // namespace tflm_signal 29 | } // namespace tflite 30 | 31 | #endif // SIGNAL_SRC_MAX_ABS_H_ 32 | -------------------------------------------------------------------------------- /signal/src/msb.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef SIGNAL_SRC_MSB_H_ 17 | #define SIGNAL_SRC_MSB_H_ 18 | 19 | #include 20 | 21 | namespace tflite { 22 | namespace tflm_signal { 23 | // TODO(b/286250473): remove namespace once de-duped libraries above 24 | 25 | // Index of the most significant bit 26 | uint32_t MostSignificantBit32(uint32_t x); 27 | uint32_t MostSignificantBit64(uint64_t x); 28 | 29 | } // namespace tflm_signal 30 | } // namespace tflite 31 | 32 | #endif // SIGNAL_SRC_MSB_H_ 33 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/memory_footprint/baseline_memory_footprint.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #include "tensorflow/lite/micro/system_setup.h" 16 | 17 | // This file provides a skeleton application without the TFLM Framework 18 | // (interpreter, memory planner etc). This is used to measure the bare minimum 19 | // application code size of a specific target platform without the TFLM 20 | // Framework. Please see README.md for more information. 21 | int main(int argc, char** argv) { tflite::InitializeTarget(); } 22 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/testing/bluepill.resc: -------------------------------------------------------------------------------- 1 | # Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # ============================================================================== 15 | 16 | using sysbus 17 | 18 | mach create 19 | machine LoadPlatformDescription @platforms/cpus/stm32f103.repl 20 | 21 | # These lines are needed to show the results of DebugLog calls in the output. 22 | machine LoadPlatformDescriptionFromString "uartSemihosting: UART.SemihostingUart @ cpu" 23 | showAnalyzer cpu.uartSemihosting Antmicro.Renode.Analyzers.LoggingUartAnalyzer 24 | cpu.uartSemihosting CreateFileBackend $logfile true 25 | 26 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/tflite_bridge/BUILD: -------------------------------------------------------------------------------- 1 | load( 2 | "//tensorflow/lite/micro:build_def.bzl", 3 | "tflm_cc_library", 4 | ) 5 | 6 | package( 7 | # Disabling layering_check because of http://b/177257332 8 | features = ["-layering_check"], 9 | licenses = ["notice"], 10 | ) 11 | 12 | tflm_cc_library( 13 | name = "flatbuffer_conversions_bridge", 14 | srcs = [ 15 | "flatbuffer_conversions_bridge.cc", 16 | ], 17 | hdrs = [ 18 | "flatbuffer_conversions_bridge.h", 19 | ], 20 | visibility = [ 21 | "//tensorflow/lite/micro:__pkg__", 22 | ], 23 | deps = [ 24 | ":micro_error_reporter", 25 | "//tensorflow/lite/c:common", 26 | "//tensorflow/lite/core/api", 27 | "//tensorflow/lite/schema:schema_fbs", 28 | ], 29 | ) 30 | 31 | tflm_cc_library( 32 | name = "micro_error_reporter", 33 | srcs = [ 34 | "micro_error_reporter.cc", 35 | ], 36 | hdrs = [ 37 | "micro_error_reporter.h", 38 | ], 39 | deps = [ 40 | "//tensorflow/lite/core/api:error_reporter", 41 | "//tensorflow/lite/micro:micro_compatibility", 42 | "//tensorflow/lite/micro:micro_log", 43 | ], 44 | ) 45 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/person_detection/image_provider.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "tensorflow/lite/micro/examples/person_detection/image_provider.h" 17 | 18 | #include "tensorflow/lite/micro/examples/person_detection/model_settings.h" 19 | 20 | TfLiteStatus GetImage(int image_width, int image_height, int channels, 21 | int8_t* image_data) { 22 | for (int i = 0; i < image_width * image_height * channels; ++i) { 23 | image_data[i] = 0; 24 | } 25 | return kTfLiteOk; 26 | } 27 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/ceva/system_setup.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "tensorflow/lite/micro/system_setup.h" 17 | 18 | #include 19 | 20 | #include "tensorflow/lite/micro/micro_time.h" 21 | 22 | namespace tflite { 23 | 24 | uint32_t ticks_per_second() { return 100e6; } 25 | 26 | uint32_t GetCurrentTimeTicks() { return static_cast(clock()); } 27 | 28 | void InitializeTarget() { 29 | // start clock for profiler 30 | reset_clock(); 31 | start_clock(); 32 | } 33 | 34 | } // namespace tflite 35 | -------------------------------------------------------------------------------- /signal/micro/kernels/rfft.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef SIGNAL_MICRO_KERNELS_RFFT_H_ 16 | #define SIGNAL_MICRO_KERNELS_RFFT_H_ 17 | 18 | #include "tensorflow/lite/micro/micro_common.h" 19 | 20 | namespace tflite { 21 | namespace tflm_signal { 22 | 23 | TFLMRegistration* Register_RFFT(); 24 | TFLMRegistration* Register_RFFT_FLOAT(); 25 | TFLMRegistration* Register_RFFT_INT16(); 26 | TFLMRegistration* Register_RFFT_INT32(); 27 | 28 | } // namespace tflm_signal 29 | } // namespace tflite 30 | 31 | #endif // SIGNAL_MICRO_KERNELS_RFFT_H_ 32 | -------------------------------------------------------------------------------- /signal/src/filter_bank_square_root.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "signal/src/filter_bank_square_root.h" 17 | 18 | #include "signal/src/square_root.h" 19 | 20 | namespace tflite { 21 | namespace tflm_signal { 22 | 23 | void FilterbankSqrt(const uint64_t* input, int num_channels, 24 | int scale_down_bits, uint32_t* output) { 25 | for (int i = 0; i < num_channels; ++i) { 26 | output[i] = Sqrt64(input[i]) >> scale_down_bits; 27 | } 28 | } 29 | 30 | } // namespace tflm_signal 31 | } // namespace tflite 32 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/hello_world/models/BUILD: -------------------------------------------------------------------------------- 1 | load("//tensorflow/lite/micro:build_def.bzl", "generate_cc_arrays") 2 | 3 | package( 4 | default_visibility = ["//visibility:public"], 5 | ) 6 | 7 | exports_files( 8 | srcs = [ 9 | "hello_world_float.tflite", 10 | "hello_world_int8.tflite", 11 | ], 12 | visibility = [ 13 | "//codegen/examples/hello_world:__subpackages__", 14 | "//tensorflow/lite/micro/examples/hello_world:__subpackages__", 15 | ], 16 | ) 17 | 18 | generate_cc_arrays( 19 | name = "generated_hello_world_float_model_cc", 20 | src = "hello_world_float.tflite", 21 | out = "hello_world_float_model_data.cc", 22 | ) 23 | 24 | generate_cc_arrays( 25 | name = "generated_hello_world_float_model_hdr", 26 | src = "hello_world_float.tflite", 27 | out = "hello_world_float_model_data.h", 28 | ) 29 | 30 | generate_cc_arrays( 31 | name = "generated_hello_world_int8_model_cc", 32 | src = "hello_world_int8.tflite", 33 | out = "hello_world_int8_model_data.cc", 34 | ) 35 | 36 | generate_cc_arrays( 37 | name = "generated_hello_world_int8_model_hdr", 38 | src = "hello_world_int8.tflite", 39 | out = "hello_world_int8_model_data.h", 40 | ) 41 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/mnist_lstm/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_python//python:defs.bzl", "py_binary", "py_test") 2 | load("@tflm_pip_deps//:requirements.bzl", "requirement") 3 | 4 | py_binary( 5 | name = "train", 6 | srcs = ["train.py"], 7 | deps = [ 8 | requirement("numpy"), 9 | requirement("tensorflow-cpu"), 10 | ], 11 | ) 12 | 13 | py_binary( 14 | name = "evaluate", 15 | srcs = ["evaluate.py"], 16 | deps = [ 17 | "//python/tflite_micro:runtime", 18 | requirement("absl_py"), 19 | requirement("pillow"), 20 | ], 21 | ) 22 | 23 | filegroup( 24 | name = "sample_images", 25 | srcs = glob(["samples/*.png"]), 26 | ) 27 | 28 | py_test( 29 | name = "evaluate_test", 30 | srcs = ["evaluate_test.py"], 31 | data = [ 32 | "trained_lstm.tflite", 33 | "trained_lstm_int8.tflite", 34 | ":sample_images", 35 | ], 36 | main = "evaluate_test.py", 37 | tags = [ 38 | "noasan", 39 | "nomsan", # Python doesn't like these symbols 40 | "noubsan", 41 | ], 42 | deps = [ 43 | ":evaluate", 44 | ":train", 45 | "//tensorflow/lite/micro/tools:requantize_flatbuffer", 46 | ], 47 | ) 48 | -------------------------------------------------------------------------------- /signal/micro/kernels/irfft.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef SIGNAL_MICRO_KERNELS_IRFFT_H_ 16 | #define SIGNAL_MICRO_KERNELS_IRFFT_H_ 17 | 18 | #include "tensorflow/lite/micro/micro_common.h" 19 | 20 | namespace tflite { 21 | namespace tflm_signal { 22 | 23 | TFLMRegistration* Register_IRFFT(); 24 | TFLMRegistration* Register_IRFFT_FLOAT(); 25 | TFLMRegistration* Register_IRFFT_INT16(); 26 | TFLMRegistration* Register_IRFFT_INT32(); 27 | 28 | } // namespace tflm_signal 29 | } // namespace tflite 30 | 31 | #endif // SIGNAL_MICRO_KERNELS_IRFFT_H_ 32 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/micro_arena_constants.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_LITE_MICRO_MICRO_ARENA_CONSTANTS_H_ 17 | #define TENSORFLOW_LITE_MICRO_MICRO_ARENA_CONSTANTS_H_ 18 | 19 | namespace tflite { 20 | 21 | // The default buffer alignment requirement. 22 | // We align tensor buffers to 16-byte boundaries, since this is a common 23 | // requirement for SIMD extensions. 24 | constexpr int MicroArenaBufferAlignment() { return 16; } 25 | 26 | } // namespace tflite 27 | 28 | #endif // TENSORFLOW_LITE_MICRO_MICRO_ARENA_CONSTANTS_H_ 29 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/system_setup.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_MICRO_SYSTEM_SETUP_H_ 16 | #define TENSORFLOW_LITE_MICRO_SYSTEM_SETUP_H_ 17 | 18 | namespace tflite { 19 | 20 | // This should called during initialization of TFLM binaries and tests. It can 21 | // be specialized if there is a need for custom target-specific intialization. 22 | // For more information, see tensorflow/lite/micro/system_setup.cc. 23 | void InitializeTarget(); 24 | 25 | } // namespace tflite 26 | 27 | #endif // TENSORFLOW_LITE_MICRO_SYSTEM_SETUP_H_ 28 | -------------------------------------------------------------------------------- /tensorflow/lite/experimental/microfrontend/lib/log_scale_util.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2018 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #include "tensorflow/lite/experimental/microfrontend/lib/log_scale_util.h" 16 | 17 | void LogScaleFillConfigWithDefaults(struct LogScaleConfig* config) { 18 | config->enable_log = 1; 19 | config->scale_shift = 6; 20 | } 21 | 22 | int LogScalePopulateState(const struct LogScaleConfig* config, 23 | struct LogScaleState* state) { 24 | state->enable_log = config->enable_log; 25 | state->scale_shift = config->scale_shift; 26 | return 1; 27 | } 28 | -------------------------------------------------------------------------------- /ci/install_buildifier.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2021 The TensorFlow Authors. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # ============================================================================== 16 | 17 | set -e 18 | # Download buildifier. 19 | wget https://github.com/bazelbuild/buildtools/releases/download/v8.2.1/buildifier-linux-amd64 20 | mv buildifier-linux-amd64 buildifier 21 | chmod +x buildifier 22 | sudo mv buildifier /usr/local/bin/. 23 | 24 | # Download buildozer. 25 | wget https://github.com/bazelbuild/buildtools/releases/download/v8.2.1/buildozer-linux-amd64 26 | mv buildozer-linux-amd64 buildozer 27 | chmod +x buildozer 28 | sudo mv buildozer /usr/local/bin/. 29 | -------------------------------------------------------------------------------- /python/tflite_micro/python_utils.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_MICRO_TOOLS_PYTHON_INTERPRETER_PYTHON_UTILS_H_ 16 | #define TENSORFLOW_LITE_MICRO_TOOLS_PYTHON_INTERPRETER_PYTHON_UTILS_H_ 17 | 18 | #include 19 | 20 | namespace tflite { 21 | 22 | struct PyDecrefDeleter { 23 | void operator()(PyObject* p) const { Py_DECREF(p); } 24 | }; 25 | 26 | int ConvertFromPyString(PyObject* obj, char** data, Py_ssize_t* length); 27 | PyObject* ConvertToPyString(const char* data, size_t length); 28 | 29 | } // namespace tflite 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/compression/metadata_saved_update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Copyright 2024 The TensorFlow Authors. All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # Run this script outside of bazel to regenerate the header-only C++ library 18 | # used for reading the metadata flatbuffer and copy it to the source tree as 19 | # $saved. See the bazel target $label. 20 | 21 | set -e 22 | 23 | workspace=$(bazel info workspace) 24 | package=tensorflow/lite/micro/compression 25 | label=//$package:metadata_cc 26 | generated=$workspace/bazel-bin/$package/metadata_generated.h 27 | saved=$workspace/$package/metadata_saved.h 28 | 29 | bazel build $label 30 | cp $generated $saved 31 | chmod 664 $saved 32 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/examples/person_detection/main.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "tensorflow/lite/micro/examples/person_detection/main_functions.h" 17 | 18 | // This is the default main used on systems that have the standard C entry 19 | // point. Other devices (for example FreeRTOS or ESP32) that have different 20 | // requirements for entry code (like an app_main function) should specialize 21 | // this main.cc file in a target-specific subfolder. 22 | int main(int argc, char* argv[]) { 23 | setup(); 24 | while (true) { 25 | loop(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /tensorflow/lite/micro/kernels/hard_swish.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_LITE_MICRO_KERNELS_HARD_SWISH_H_ 17 | #define TENSORFLOW_LITE_MICRO_KERNELS_HARD_SWISH_H_ 18 | 19 | #include "tensorflow/lite/c/builtin_op_data.h" 20 | #include "tensorflow/lite/c/common.h" 21 | 22 | namespace tflite { 23 | 24 | extern const int kHardSwishInputTensor; 25 | extern const int kHardSwishOutputTensor; 26 | 27 | TfLiteStatus HardSwishPrepare(TfLiteContext* context, TfLiteNode* node); 28 | } // namespace tflite 29 | 30 | #endif // TENSORFLOW_LITE_MICRO_KERNELS_HARD_SWISH_H_ 31 | -------------------------------------------------------------------------------- /signal/micro/kernels/framer_flexbuffers_generated_data.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef SIGNAL_MICRO_KERNELS_TEST_DATA_GENERATION_GENERATE_FRAMER_FLEXBUFFERS_DATA_H_ 17 | #define SIGNAL_MICRO_KERNELS_TEST_DATA_GENERATION_GENERATE_FRAMER_FLEXBUFFERS_DATA_H_ 18 | 19 | extern const int g_gen_data_size_3_1_0_framer; 20 | extern const unsigned char g_gen_data_3_1_0_framer[]; 21 | 22 | extern const int g_gen_data_size_5_2_1_framer; 23 | extern const unsigned char g_gen_data_5_2_1_framer[]; 24 | 25 | #endif // SIGNAL_MICRO_KERNELS_TEST_DATA_GENERATION_GENERATE_FRAMER_FLEXBUFFERS_DATA_H_ 26 | --------------------------------------------------------------------------------