Subgraph::ModifyGraphWithDelegate methods did not specify
the behaviour when the delegate parameter is null.
PiperOrigin-RevId: 352655477
Change-Id: Ia3997ba325cb76b3c76c8672c4b6102343da8443
a new unit test interpreter_utils_test.cc, to match the name of the
file interpreter_utils.cc which defines InvokeWithCPUFallback.
This required moving the test infrastructure that is now shared
between delegate_test.cc and interpreter_test.cc into a separate
compilation unit delegate_test_utils.{h,cc}.
PiperOrigin-RevId: 345034742
Change-Id: If91f0d70d0b4d8c160685f13d6e313dd16fd5425
This enables TFLite Micro to selectively include these setter functions in unit tests. The APIs used in creating the flatbuffer introduce new and delete symbols which can cause issues for libraries not fully building with --gc-sections in linker flags.
PiperOrigin-RevId: 339324965
Change-Id: I720b8dab6d80a94a47b7c8c427067966e2c42943
This change is a preliminary work for resolving builtin code shortage problem.
It introduces a new utility build target, schema_utils, which will be used for
getting/setting builtin code operator value in TFLite flatbuffer in order to
have a single place to access actual fields for accessing values.
See also the RFC proposal draft,
https://github.com/tensorflow/community/pull/285
PiperOrigin-RevId: 335513647
Change-Id: I810a33425bbed3489cfe4a4a98a10dc4bd67a6ba
As part of ongoing refactoring, `tflite::GetInput`, `tflite::GetOutput`, `tflite::GetTemporary` and `tflite::GetIntermediates` will return `nullptr` in some cases. Hence, we insert the `nullptr` checks on all usages.
We also insert `nullptr` checks on usages of `tflite::GetVariableInput` and `tflite::GetOptionalInputTensor` but only in the cases where there is no obvious check that `nullptr` is acceptable (that is, we only insert the check for the output of these two functions if the tensor is accessed as if it is always not `nullptr`).
PiperOrigin-RevId: 332517854
Change-Id: Ic27221dd1f0fbe302f311c2fe5a846ed8ff02016