| 2137 | } |
| 2138 | |
| 2139 | Status HloInstruction::ReplaceOperandWith(int64 operand_num, |
| 2140 | HloInstruction* new_operand) { |
| 2141 | auto old_operand = operand(operand_num); |
| 2142 | TF_RET_CHECK(ShapeUtil::CompatibleIgnoringFpPrecision(old_operand->shape(), |
| 2143 | new_operand->shape())) |
| 2144 | << old_operand->shape() << " is not compatible with " |
| 2145 | << new_operand->shape(); |
| 2146 | return ReplaceOperandWithDifferentShape(operand_num, new_operand); |
| 2147 | } |
| 2148 | |
| 2149 | Status HloInstruction::ReplaceOperandWithDifferentShape( |
| 2150 | int64 operand_num, HloInstruction* new_operand) { |