| 43 | } |
| 44 | |
| 45 | std::vector<HloPosition> HloBuffer::ComputePositions() const { |
| 46 | std::vector<HloPosition> positions; |
| 47 | for (const HloValue* value : values_) { |
| 48 | positions.insert(positions.end(), value->positions().begin(), |
| 49 | value->positions().end()); |
| 50 | } |
| 51 | // Remove duplicates and sort positions. |
| 52 | absl::c_sort(positions); |
| 53 | positions.erase(std::unique(positions.begin(), positions.end()), |
| 54 | positions.end()); |
| 55 | return positions; |
| 56 | } |
| 57 | |
| 58 | string HloBuffer::ToString() const { |
| 59 | return absl::StrCat( |