Commit Graph

15 Commits

Author SHA1 Message Date
Fergus Henderson
d22d31bebd Fix issue where the Interpreter::ModifyGraphWithDelegate and
Subgraph::ModifyGraphWithDelegate methods did not specify
the behaviour when the delegate parameter is null.

PiperOrigin-RevId: 352655477
Change-Id: Ia3997ba325cb76b3c76c8672c4b6102343da8443
2021-01-19 14:35:57 -08:00
Fergus Henderson
0b2e5e42d5 Split delegate_test.cc: move tests of InvokeWithCPUFallback into
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
2020-12-01 09:28:26 -08:00
Fergus Henderson
2a38613c50 Fix misleading comments in delegate_test.cc.
PiperOrigin-RevId: 344855744
Change-Id: I549ed1d2f03f51bf2189f97fdcafcb1b88125076
2020-11-30 11:46:23 -08:00
Dmitry Volodin
04ff97cbb6 fix typos in lite directory 2020-10-29 04:39:35 +03:00
Nick Kreeger
48c3bae94a Split getter and setter functions in schema utility files.
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
2020-10-27 14:12:18 -07:00
Jaesung Chung
17f94a78e8 Refactor reading builtin code in TFLite
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
2020-10-05 15:36:21 -07:00
Sachin Joglekar
bb23ba4875 Fix delegate fallback (delegation/invoke) for FP16 graphs. Also add new test cases for Fp16GraphPartitionHelper.
PiperOrigin-RevId: 333098545
Change-Id: Icaf93aee6669d5b8d593392d5c227bd82d6839b4
2020-09-22 09:52:45 -07:00
A. Unique TensorFlower
4c425d4dbf Fix delegate fallback (delegation/invoke) for FP16 graphs. Also add new test cases for Fp16GraphPartitionHelper.
PiperOrigin-RevId: 332890609
Change-Id: I2e7574910864c5c13db7fa1de540ee0c30a030e6
2020-09-21 11:17:51 -07:00
Sachin Joglekar
2321f691fd Fix delegate fallback (delegation/invoke) for FP16 graphs. Also add new test cases for Fp16GraphPartitionHelper.
PiperOrigin-RevId: 332865813
Change-Id: I362d2ab05f24dcdc26aad003b2cee8bc06f9c580
2020-09-21 09:36:03 -07:00
Mihai Maruseac
e11f55585f [tflite]: Insert nullptr checks when obtaining tensors.
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
2020-09-18 13:53:51 -07:00
Fergus Henderson
0e68f4d329 Fix an include-what-you-use violation: include interpreter_builder.h
from delegate_test.cc, for InterpreterBuilder.

PiperOrigin-RevId: 332509756
Change-Id: Ica7a14bfe7174664dd9e7e89db13ca93f541c225
2020-09-18 13:11:38 -07:00
Sachin Joglekar
8edf47bfcc Fix partitioning bug for multiple-delegate cases
PiperOrigin-RevId: 331184246
Change-Id: I22e1c3d195dcbbf846d7cef95aba8507bdd90b7b
2020-09-11 11:28:05 -07:00
Sachin Joglekar
78597f43dc Add a new delegate flag to propagate shapes via the runtime
PiperOrigin-RevId: 325116169
Change-Id: Ib96e80016131c3b0d5741f5dffbe0362ef21d330
2020-08-05 15:44:20 -07:00
A. Unique TensorFlower
7738c1818e Roll forward API for automatic fallback on delegation failure.
PiperOrigin-RevId: 313353207
Change-Id: I0f7824ecc5421a179c10a6de4fc5192e9815abb7
2020-05-27 02:26:48 -07:00
Sachin Joglekar
119aa03c76 Split delegate-specific interpreter tests into a separate file
PiperOrigin-RevId: 312372505
Change-Id: If366a884ce090f2ad40bdc20d266ef32eb5a1765
2020-05-19 16:06:19 -07:00