| 971 | } |
| 972 | |
| 973 | Status HloDataflowAnalysis::Verify() const { |
| 974 | // Verify each HloValue appears in the value sets that the value's positions() |
| 975 | // indicate. |
| 976 | for (const HloValue* value : values()) { |
| 977 | for (const HloPosition& position : value->positions()) { |
| 978 | const HloValueSet& value_set = GetValueSet(position); |
| 979 | TF_RET_CHECK(absl::c_linear_search(value_set.values(), value)) |
| 980 | << "Value set at position " << position << " does not contain value " |
| 981 | << value->ToShortString(); |
| 982 | } |
| 983 | } |
| 984 | |
| 985 | // For each value in each value set, verify that the value set's position |
| 986 | // appears in the value's positions(). |
| 987 | for (const auto& computation : module_.computations()) { |
| 988 | for (const auto& instruction : computation->instructions()) { |
| 989 | for (const auto& pair : GetInstructionValueSet(instruction)) { |
| 990 | const ShapeIndex& index = pair.first; |
| 991 | const HloValueSet& value_set = pair.second; |
| 992 | const HloPosition position{instruction, index}; |
| 993 | for (const HloValue* value : value_set.values()) { |
| 994 | TF_RET_CHECK(absl::c_linear_search(value->positions(), position)) |
| 995 | << "Value set at position " << position |
| 996 | << " unexpectedly contains value " << value->ToShortString(); |
| 997 | } |
| 998 | } |
| 999 | } |
| 1000 | } |
| 1001 | |
| 1002 | return Status::OK(); |
| 1003 | } |
| 1004 | |
| 1005 | bool HloDataflowAnalysis::DoesNotUseOperandBuffer( |
| 1006 | const HloInstruction* operand, const ShapeIndex& index, |
no test coverage detected