[XLA] Keep op metadata when replacing with bitcast.

PiperOrigin-RevId: 316667446
Change-Id: I3618b5eafba269eb087ff7607bdad1cb3873ffbc
This commit is contained in:
Thomas Joerg 2020-06-16 06:21:33 -07:00 committed by TensorFlower Gardener
parent 35fc231281
commit b8b6bc58a1

View File

@ -573,6 +573,7 @@ void AlgebraicSimplifierVisitor::ReplaceWithBitcast(HloInstruction* instruction,
auto bitcast = computation_->AddInstruction(
HloInstruction::CreateBitcast(instruction->shape(), operand));
bitcast->set_metadata(instruction->metadata());
TF_CHECK_OK(ReplaceInstruction(instruction, bitcast));
}