diff --git a/xla/service/hlo_verifier.cc b/xla/service/hlo_verifier.cc index b62ef43c92c0d5..d3bae8d7144c1a 100644 --- a/xla/service/hlo_verifier.cc +++ b/xla/service/hlo_verifier.cc @@ -1359,8 +1359,9 @@ absl::Status ShapeVerifier::HandleFusion(HloInstruction* fusion) { } } else { TF_RET_CHECK(ShapeUtil::Compatible(output_subshape, operand_subshape)) - << "Different aliasing shapes: " << operand_subshape.ToString() - << " vs " << output_subshape.ToString(); + << "Different aliasing shapes: " + << operand_subshape.ToString(/*print_layout=*/true) << " vs " + << output_subshape.ToString(/*print_layout=*/true); } } return absl::OkStatus(); @@ -1440,12 +1441,14 @@ absl::Status ShapeVerifier::HandleCustomCall(HloInstruction* instruction) { custom_call->operand(pair.second.first)->shape(), pair.second.second); if (opts_.layout_sensitive) { TF_RET_CHECK(operand_subshape == output_subshape) - << "Different aliasing shapes: " << operand_subshape.ToString() - << " vs " << output_subshape.ToString(); + << "Different aliasing shapes: " + << operand_subshape.ToString(/*print_layout=*/true) << " vs " + << output_subshape.ToString(/*print_layout=*/true); } else { TF_RET_CHECK(ShapeUtil::Compatible(output_subshape, operand_subshape)) - << "Different aliasing shapes: " << operand_subshape.ToString() - << " vs " << output_subshape.ToString(); + << "Different aliasing shapes: " + << operand_subshape.ToString(/*print_layout=*/true) << " vs " + << output_subshape.ToString(/*print_layout=*/true); } } return absl::OkStatus(); @@ -1660,7 +1663,8 @@ absl::Status ShapeVerifier::CheckAsyncOpComputationShapes( return Internal( "The %s expects the async shape to be a tuple of at least two " "elements, found %s.", - HloOpcodeString(async_op->opcode()), async_shape.ToString()); + HloOpcodeString(async_op->opcode()), + async_shape.ToString(/*print_layout=*/true)); } ProgramShape computation_shape =