From b8b6bc58a1954353b6fbd49e6d7a0d1f6ad18072 Mon Sep 17 00:00:00 2001 From: Thomas Joerg Date: Tue, 16 Jun 2020 06:21:33 -0700 Subject: [PATCH] [XLA] Keep op metadata when replacing with bitcast. PiperOrigin-RevId: 316667446 Change-Id: I3618b5eafba269eb087ff7607bdad1cb3873ffbc --- tensorflow/compiler/xla/service/algebraic_simplifier.cc | 1 + 1 file changed, 1 insertion(+) 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)); }