diff --git a/tensorflow/compiler/xla/service/layout_assignment.cc b/tensorflow/compiler/xla/service/layout_assignment.cc index aa791ea195e7a88fd8ad28fd0b60c88dea8a6928..bf1d1c233f126b9a0014871cdfe77fd9ce725369 100644 --- a/tensorflow/compiler/xla/service/layout_assignment.cc +++ b/tensorflow/compiler/xla/service/layout_assignment.cc @@ -1019,16 +1019,6 @@ std::unique_ptr LayoutAssignment::ChooseOperandLayoutFromOutputLayout( Shape operand_shape = operand->shape(); *operand_shape.mutable_layout() = LayoutUtil::GetDefaultLayoutForShape(operand_shape); - if (ShapeUtil::ReshapeIsBitcast(operand_shape, output_shape_with_layout)) { - return absl::make_unique(operand_shape.layout()); - } - if (operand_shape.rank() == output_shape.rank()) { - *operand_shape.mutable_layout() = output_layout; - if (ShapeUtil::ReshapeIsBitcast(operand_shape, - output_shape_with_layout)) { - return absl::make_unique(output_layout); - } - } auto aligned_operand_shape = ShapeUtil::AlignLayouts(output_shape_with_layout, operand_shape); if (aligned_operand_shape) { @@ -1090,16 +1080,6 @@ std::unique_ptr LayoutAssignment::ChooseOutputLayoutFromOperandLayout( Shape output_shape = user->shape(); *output_shape.mutable_layout() = LayoutUtil::GetDefaultLayoutForShape(output_shape); - if (ShapeUtil::ReshapeIsBitcast(output_shape, operand_shape_with_layout)) { - return absl::make_unique(output_shape.layout()); - } - if (operand->shape().rank() == output_shape.rank()) { - *output_shape.mutable_layout() = operand_layout; - if (ShapeUtil::ReshapeIsBitcast(output_shape, - operand_shape_with_layout)) { - return absl::make_unique(operand_layout); - } - } auto aligned_user_shape = ShapeUtil::AlignLayouts(operand_shape_with_layout, output_shape); if (aligned_user_shape) {