Add op metadata to bitcasts inserted by ReductionLayoutNormalizer.

PiperOrigin-RevId: 316707766
Change-Id: I11aa5e9c32e86d63981398605c50a73ac9149303
This commit is contained in:
Thomas Joerg 2020-06-16 10:27:26 -07:00 committed by TensorFlower Gardener
parent 0ad71d87d8
commit 7fb05db5b0

View File

@ -101,6 +101,7 @@ class EnforceMinorToMajorReduceOpVisitor : public DfsHloRewriteVisitor {
new_reduce_shape_layout);
HloInstruction *canonical_reduce_input = reduce->parent()->AddInstruction(
HloInstruction::CreateBitcast(new_operand_shape, operand));
canonical_reduce_input->set_metadata(reduce->metadata());
VLOG(5) << "Reduction input: " << canonical_reduce_input->ToString();
std::unique_ptr<HloInstruction> new_reduce = HloInstruction::CreateReduce(