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
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
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
- 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
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
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