Commit Graph

27 Commits

Author SHA1 Message Date
A. Unique TensorFlower
c870b9f920 Qualify uses of std::string
PiperOrigin-RevId: 316907769
Change-Id: I01c3ca5f0fb1b1b2284ae5969da968cec7493583
2020-06-17 09:54:59 -07:00
Kazuaki Ishizaki
70efc8c05c minor spelling tweaks 2020-03-19 01:52:50 +09:00
Penporn Koanantakool
90e67385a4 Add Matrix{Diag,SetDiag,DiagPart}V3 ops with alignment options.
V2 ops always align the diagonals to the left (LEFT_LEFT) in the compact format. V3 ops support 4 alignments: RIGHT_LEFT, LEFT_RIGHT, LEFT_LEFT, and RIGHT_RIGHT. We would like to use RIGHT_LEFT as the default alignment. This contradicts with v2's behavior so we need new a version.

V2 has never been exposed to the public APIs. We will skip V2 and go from V1 to V3 directly. V3 features are currently under forward compatibility guards and will be enabled automatically in ~3 weeks from now.

This commit contains
- V3 API definitions.
- Modifications to C++ Matrix{Diag,SetDiag,DiagPart}Op kernels (CPU, GPU, XLA) and shape inference functions to support v3.
- Additional tests and gradient implementations in Python for v3.
- Pfor and TFLite TOCO converters for v3.
- The TFLite MLIR converter for MatrixDiagV3 is intentionally left out because of an MLIR test infrastructure issue and will be added in a separate commit.

Notes:
- Python changes cannot be in a separate follow-up commit because all kernel tests are in Python. (No C++ tests.)
- All three ops have to be in the same commit because their gradients call each other.
PiperOrigin-RevId: 280527550
Change-Id: I88e91abab5c4b50419204807ede4fa60657f048a
2019-11-14 16:02:19 -08:00
Renjie Liu
4d6468d268 Add toco pass to recognize nearest neighbor upsampling using brodcast and convert it will pack-based.
PiperOrigin-RevId: 277875922
Change-Id: If7e01982e0af709c2c9e690629f96459ed51256b
2019-11-01 00:00:47 -07:00
Benoit Jacob
928ec43c66 Log the number of parameters. Improve the logging of arithmetic ops.
PiperOrigin-RevId: 263609536
2019-08-15 12:39:01 -07:00
A. Unique TensorFlower
40a34d1491 Converts hardswish subgraphs into atomic ops.
PiperOrigin-RevId: 262789479
2019-08-11 02:41:01 -07:00
A. Unique TensorFlower
bef807a6d6 Add a graph transformation to identify and fuse success transposes that are noops
PiperOrigin-RevId: 262034930
2019-08-06 17:58:37 -07:00
Tiezhen WANG
dcb3eec82f TFL micro: Add allow_dynamic_tensor flag to TOCO.
PiperOrigin-RevId: 256914004
2019-07-07 23:37:40 -07:00
A. Unique TensorFlower
fc59dc2cff support MatrixSetDiagV2 op
PiperOrigin-RevId: 256211310
2019-07-02 14:27:47 -07:00
A. Unique TensorFlower
ec87f72b9a support MatrixDiagV2 op
PiperOrigin-RevId: 256070251
2019-07-01 19:01:23 -07:00
A. Unique TensorFlower
3742faa90c Support quantization to float16
PiperOrigin-RevId: 248790891
2019-05-17 14:57:42 -07:00
Yu-Cheng Ling
1c4476b44d Automated rollback of commit 4b7fb47dab
PiperOrigin-RevId: 244055462
2019-04-17 13:58:19 -07:00
Yu-Cheng Ling
4b7fb47dab Do not fold Rank and Shape ops to constants in TFLite
PiperOrigin-RevId: 243911869
2019-04-16 18:56:41 -07:00
A. Unique TensorFlower
0e4117f671 Automated rollback of commit a6aa65015e
PiperOrigin-RevId: 243752707
2019-04-15 23:32:07 -07:00
Yu-Cheng Ling
a6aa65015e Do not fold Rank and Shape ops to constants in TFLite
END_PUBLIC

== Below is copied from the previous CL description ==

Currently TFLite allows to resize input tensors to any shape. Folding Rank
and Shape may lead to incorrect results when input is resized.

PiperOrigin-RevId: 243707412
2019-04-15 16:27:24 -07:00
A. Unique TensorFlower
8901eff309 Automated rollback of commit cdfedf4812
PiperOrigin-RevId: 240465575
2019-03-26 17:51:36 -07:00
Yu-Cheng Ling
cdfedf4812 Do not fold Rank and Shape ops to constants in TFLite
Currently TFLite allows to resize input tensors to any shape. Folding Rank
and Shape may lead to incorrect results when input is resized.

PiperOrigin-RevId: 240402315
2019-03-26 12:30:28 -07:00
A. Unique TensorFlower
2f76e2846d Support dynamic bidirectional sequence rnn and dynamic bidirectional sequence lstm.
PiperOrigin-RevId: 234947978
2019-02-21 01:03:23 -08:00
A. Unique TensorFlower
08703e1aad Multiple enhancements to graphviz output:
- nodes organized by subgraphs inferred from array names
  - subgraphs and ops include math op count estimates
  - better organized labels on all nodes
  - operators have numbered inputs and outputs when two or more exist
  - specific node shapes for inputs/outputs
  - node color scheme unchanged

PiperOrigin-RevId: 233446311
2019-02-11 11:40:41 -08:00
A. Unique TensorFlower
ec7958da20 Fewer TOCO crashes.
PiperOrigin-RevId: 232730162
2019-02-06 13:13:59 -08:00
A. Unique TensorFlower
63b38ce4a8 Support bidirectional sequence rnn for tflite.
PiperOrigin-RevId: 230650050
2019-01-23 20:04:39 -08:00
A. Unique TensorFlower
9b27163135 Support tf.nn.static_bidirectional_rnn using Ophints.
PiperOrigin-RevId: 230198367
2019-01-21 02:56:46 -08:00
A. Unique TensorFlower
c10447d959 Allow easier re-running of toco on already quantized, mixed-bit-depth
tflite models, by:
  - fixing a bug whereby PropagateArrayDataTypes was brutally propagating
    the data type of its first input onto all outputs;
  - not letting QUANTIZED_UINT8 override existing non-8bit quantized data
    types.

PiperOrigin-RevId: 229858747
2019-01-17 19:05:49 -08:00
A. Unique TensorFlower
b3710b27cc TOCO should be OK with using constant arrays as outputs.
PiperOrigin-RevId: 223994547
2018-12-04 09:54:38 -08:00
A. Unique TensorFlower
760ef2cc7e Allow intermediate string tensors
PiperOrigin-RevId: 222298206
2018-11-20 13:39:25 -08:00
Yu-Cheng Ling
fb3bcc39a5 Rename flex_ops -> select_tf_ops in Toco flags
PiperOrigin-RevId: 219719783
2018-11-01 16:35:37 -07: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