tf_1.8_xla_doc
|
#include <reshape_mover.h>
Inherits HloPassInterface.
Google docs:
A pass which moves Reshapes and Transposes to let later passes combine them. This now only moves them outputward across elementwise ops all whose operands are equivalent Reshapes or Transposes, but in future could potentially move them inputward also.
Implementation note from Google doc:
The general idea behind this pass is that we're converting from this:
To this:
Where the instruction must be elementwise, and both reshapes and transposes are moved.
Most elementwise instructions support implicit broadcast of scalar operands, but select is a special-case. The signature is Select(Pred, A, B), and the only implicit scalar broadcast is on Pred, not on A or B. Since reshapes or transposes to a scalar should be cheap, we simply never move them.