Commit Graph

17 Commits

Author SHA1 Message Date
Thai Nguyen
e9781e9b16 Support TFLite in the tool to print selective registration header
PiperOrigin-RevId: 314282031
Change-Id: Ie71b434c177d03e246a5cfde3d067ac695b71299
2020-06-02 00:49:20 -07:00
Jared Duke
b8d991c9b4 [tf.lite] Fix issue with direct ByteBuffer inputs and dynamic graphs
In these graphs, the input tensor pointers may get "refreshed" during
invocation. This refresh is fine if the original pointer came from the
arena, but if it comes from something like the direct ByteBuffer raw
address, the input data will be lost.

Avoid this by simply using memcpy from the direct ByteBuffer. This is
still quite fast, but avoids the hack where we simply inject the
direct ByteBuffer address as the tensor buffer pointer.

A longer term solution will formally allow providing "custom" allocated
regions to tensor inputs, but until then, do the safe thing.

PiperOrigin-RevId: 310643333
Change-Id: I05dfebd24617ebb1af7eb281ff9e530b01669093
2020-05-08 15:51:50 -07:00
Yunlu Li
b65b240474 Update sparse_tensor model.
PiperOrigin-RevId: 301879775
Change-Id: I5a82a592f80f2af6624328a3596f27cf9a8c9959
2020-03-19 13:11:11 -07:00
Haoliang Zhang
30f3741ddf Export min_runtime_version in MLIR converter
This change fixes the issue for missing min_runtime_version in flatbuffers exported by MLIR converter. Specifically:

*Export `min_runtime_version` in metadata of flatbuffer (fixed-length byte array).

*Update all related mlir tests to have metadata.

PiperOrigin-RevId: 299894972
Change-Id: Ic79f3ab05b593882362f5baf62493861961acbe3
2020-03-09 12:02:29 -07:00
Dayeong Lee
70fab67be3 Support user-specified string input in tflite benchmark tools.
- Users can give it with flag "--input_layer_value_files". For example, if there are 2 input tensors, --input_layer_value_files=input1:input1_file_path,input2:input2_file.
- The list of strings are separated with the delimiter '\0'. For example, if the tensor shape is (1x3xSTRING), the file format should be "first_string_value\0second_string_value\0third_string_value\0".

PiperOrigin-RevId: 299272934
Change-Id: Iab5951c903fb4976e0dcf43dd09ba4695653dab3
2020-03-05 21:54:45 -08:00
Yunlu Li
e318ac94b9 Use variable buffer type for sparse tensor metadata.
PiperOrigin-RevId: 296530052
Change-Id: Ieab047fb73d7b15c26d716bd43c18b8187acc3e0
2020-02-21 16:05:18 -08:00
Yunlu Li
1640ac6ad6 Add verifier check for sparse tensors.
PiperOrigin-RevId: 286286868
Change-Id: I92bb40fb8eff9a16e5b382fec19befd39c93aeaa
2019-12-18 16:18:31 -08:00
Yunlu Li
85a46fbf52 Sparse tensor definition in TFLite.
PiperOrigin-RevId: 283994681
Change-Id: Ie9ddfa9c044a3b347a9e9ecf01b69516fbf9493a
2019-12-05 09:56:53 -08:00
A. Unique TensorFlower
0f85db356d Sparse tensor definition in TFLite.
PiperOrigin-RevId: 283886690
Change-Id: I66789d53ac2c7bdd85762cec14ec95748d0259f2
2019-12-04 19:16:56 -08:00
Yunlu Li
4c1ad6329a Sparse tensor definition in TFLite.
PiperOrigin-RevId: 283857867
Change-Id: If52f0176910801681a65b74ef87e9a1956ce7b71
2019-12-04 16:18:13 -08:00
Jian Li
fdf3c17211 Create the mechanism to register logging op in calibrator and add LSTM through this mechanism. It allows multiple logging kernel for one op, and also opens the possibility of user defined (not builtin) logging kernels.
The added LSTM supports layer norm and projection. Will add LSTM logging kernel for the other variants.

PiperOrigin-RevId: 279388926
Change-Id: I84ede1a3994e186a9024eaad344594cfa47199a6
2019-11-08 18:37:28 -08:00
A. Unique TensorFlower
0228bf0854 Added features to gen_selected_ops.
- Allow to  put RegisterSelectedOps in a namespace.
- Support versioned ops.
- Support multiple input tflite models.

PiperOrigin-RevId: 270053948
2019-09-19 09:15:34 -07:00
Haoliang Zhang
a3bdb597ca Export model's minimum required runtime string into flatbuffer's metadata field. Also add a method in FlatBufferModel to parse the runtime string.
PiperOrigin-RevId: 261418624
2019-08-02 18:12:27 -07:00
Yunlu Li
d2ebdd72af Add support for int8 input type in tflite_driver.
PiperOrigin-RevId: 241600181
2019-04-02 14:34:18 -07:00
Yunlu Li
d5fb65ff33 Op level diff test.
PiperOrigin-RevId: 233089842
2019-02-08 11:30:59 -08:00
Yunlu Li
0bdf7e66fc Update test data multi_add.json.
PiperOrigin-RevId: 229399229
2019-01-15 10:59:19 -08:00
Austin Anderson
61c6c84964 Migrate TensorFlow Lite out of tensorflow/contrib
This change moves //tensorflow/contrib/lite to //tensorflow/lite in preparation
for TensorFlow 2.0's deprecation of contrib/. If you refer to TF Lite build
targets or headers, you will need to update them manually. If you use TF Lite
from the TensorFlow python package, "tf.contrib.lite" now points to "tf.lite".
Please update your imports as soon as possible.

For more details, see https://groups.google.com/a/tensorflow.org/forum/#!topic/tflite/iIIXOTOFvwQ

@angersson and @aselle are conducting this migration. Please contact them if
you have any further questions.

PiperOrigin-RevId: 219536476
2018-10-31 14:20:28 -07:00