message: Change HLO verifier semantics for bitcasts to: Bitcasts that are not the root of a computation can be any shape byte size. Bitcasts that are the root of a computation must have the same shape byte size as their operand.
diff: @@ -143,9 +143,13 @@ class ShapeVerifier : public DfsHloVisitor {
  }
  Status HandleBitcast(HloInstruction* bitcast) override {
  - // Bitcasts can be any shape, as long as the size matches the operand size.
  + // Bitcasts that are not the root of a computation can be any shape.
  + // Bitcasts that are the root of a computation must have the same shape
  + // byte size as their operand.
  + if (bitcast->parent()->root_instruction() == bitcast) {
  TF_RET_CHECK(shape_size_fn_(bitcast->shape()) ==
  shape_size_fn_(bitcast->operand(0)->shape()));
  + }
  return tensorflow::Status::OK();
  }
  