| 2108 | } |
| 2109 | |
| 2110 | Status HloInstruction::ReplaceUseWith(HloInstruction* user, |
| 2111 | HloInstruction* new_producer) { |
| 2112 | TF_RET_CHECK( |
| 2113 | ShapeUtil::CompatibleIgnoringFpPrecision(shape(), new_producer->shape())) |
| 2114 | << "this shape: " << ShapeUtil::HumanString(shape()) |
| 2115 | << ", replacement shape: " |
| 2116 | << ShapeUtil::HumanString(new_producer->shape()); |
| 2117 | return ReplaceUseWithDifferentShape(user, new_producer); |
| 2118 | } |
| 2119 | |
| 2120 | Status HloInstruction::ReplaceUseWithDifferentShape( |
| 2121 | HloInstruction* user, HloInstruction* new_producer) { |