diff --git a/tensorflow/compiler/xla/service/algebraic_simplifier.cc b/tensorflow/compiler/xla/service/algebraic_simplifier.cc index f88f08b9fa2..98e3229b062 100755 --- a/tensorflow/compiler/xla/service/algebraic_simplifier.cc +++ b/tensorflow/compiler/xla/service/algebraic_simplifier.cc @@ -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)); }