| 346 | } |
| 347 | |
| 348 | Status ShapeVerifier::HandleOutfeed(HloInstruction* instruction) { |
| 349 | HloOutfeedInstruction* outfeed = Cast<HloOutfeedInstruction>(instruction); |
| 350 | TF_RETURN_IF_ERROR(CheckIsTokenOperand(instruction, 1)); |
| 351 | |
| 352 | // Outfeed has a separate shape field for the value which is outfed to the |
| 353 | // host. The shape of the instruction itself is always a token. |
| 354 | if (!ShapesSame(outfeed->outfeed_shape(), outfeed->operand(0)->shape())) { |
| 355 | return InternalError( |
| 356 | "Expected outfeed shape to be equal to operand's shape %s, " |
| 357 | "actual shape is %s:\n%s", |
| 358 | StringifyShape(outfeed->operand(0)->shape()), |
| 359 | StringifyShape(outfeed->outfeed_shape()), outfeed->ToString()); |
| 360 | } |
| 361 | return CheckShape(outfeed, ShapeUtil::MakeTokenShape()); |
| 362 | } |
| 363 | |
| 364 | bool ShapeVerifier::HasCompatibleElementTypes(const Shape& shape_0, |
| 365 | const Shape& shape_1, |
no test coverage detected