message: [XLA] Reshape/Transpose should not be bitcast if element type changes.
diff: @@ -1076,6 +1076,10 @@ ShapeUtil::DimensionsUnmodifiedByReshape(const Shape& input_shape,
  CHECK(LayoutUtil::HasLayout(input_shape) &&
  LayoutUtil::HasLayout(output_shape));
  + if (!SameElementType(input_shape, output_shape)) {
  + return false;
  + }
  +
  // Padding is not handled.
  if (LayoutUtil::IsPadded(input_shape) && LayoutUtil::IsPadded(output_shape)) {
  return false;
  @@ -1106,6 +1110,10 @@ ShapeUtil::DimensionsUnmodifiedByReshape(const Shape& input_shape,
  CHECK(LayoutUtil::HasLayout(input_shape) &&
  LayoutUtil::HasLayout(output_shape));
  + if (!SameElementType(input_shape, output_shape)) {
  + return false;
  + }
  +
  // Padding is not handled.
  if (LayoutUtil::IsPadded(input_shape) || LayoutUtil::IsPadded(output_shape)) {
  return false;
  