Three operators are added that can be used to decrease the number of
authorA. Unique TensorFlower <gardener@tensorflow.org>
Tue, 3 Apr 2018 17:35:00 +0000 (10:35 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Tue, 3 Apr 2018 17:37:47 +0000 (10:37 -0700)
commit895566e3af6e3e44eb22d0c2d20b4890e42982fc
tree46a3b5fe397a5afeacc5c927bd5203218be2d458
parentf005999d571536b859229229e4487cf749d9a786
Three operators are added that can be used to decrease the number of
transpose/reshape occurences. These operators are:
- Swap elementwise
- Swap reshape-transpose
- Fuse transpose-reshape

Swap elementwise groups operations that operate on value, and move values. This
allows all movement operations (reshape, transpose, etc) to group at one
portion of the graph while value manipulations group on the other end.

Swap reshape/transpose finds cases where the reshape-transpose can be reorderd.
This allows the reshape-transpose-reshape case to be transformed to
transpose-reshape-reshape, which can then merge the reshape-reshape.

Finally the transpose-reshape merge allows cases where, when reshape maintains
the same dimensions and does not affect memory ordering, the transpose and
reshape can be merged into a single transpose operator.

PiperOrigin-RevId: 191462038
tensorflow/contrib/lite/toco/BUILD
tensorflow/contrib/lite/toco/graph_transformations/graph_transformations.h
tensorflow/contrib/lite/toco/graph_transformations/merge_reshape_into_preceding_transpose.cc [new file with mode: 0644]
tensorflow/contrib/lite/toco/graph_transformations/reorder_activation_functions.cc [deleted file]
tensorflow/contrib/lite/toco/graph_transformations/reorder_elementwise_unary.cc [new file with mode: 0644]
tensorflow/contrib/lite/toco/graph_transformations/reorder_reshape_transpose.cc [new file with mode: 0644]
tensorflow/contrib/lite/toco/graph_transformations/resolve_tensorflow_matmul.cc
tensorflow/contrib/lite/toco/toco_tooling.cc
tensorflow/contrib/lite/toco/tooling_util.cc
tensorflow/contrib/lite/toco/tooling_util.h