[XLA] Do not recompute flattened sets inside layout assignment.
authorMichael Kuperstein <mkuper@google.com>
Mon, 26 Feb 2018 18:52:05 +0000 (10:52 -0800)
committerGunhan Gulsoy <gunan@google.com>
Tue, 27 Feb 2018 22:33:33 +0000 (14:33 -0800)
commitc6312773dd5473fb47f73c88c2f5c8f41e20c0fa
tree4cd4e9e3567f7e6c3c7fcd5abc5b676e538127ae
parentf487340e7628802b1b8c3b12747f3b9ce9254af3
[XLA] Do not recompute flattened sets inside layout assignment.

Cache the flattened sets instead of recomputing them. This matters for large graphs, since we may request the flattened set thousands of times on the same instruction, and it may be fairly expensive to construct for large tuples.

PiperOrigin-RevId: 187046642
tensorflow/compiler/xla/service/layout_assignment.cc
tensorflow/compiler/xla/service/layout_assignment.h