| 412 | } |
| 413 | |
| 414 | std::set<BufferAllocation::Slice> BufferAssignment::GetAllSlices( |
| 415 | const HloInstruction* instruction, const ShapeIndex& index) const { |
| 416 | std::set<BufferAllocation::Slice> result; |
| 417 | for (const HloValue* value : |
| 418 | dataflow_analysis().GetValueSet(instruction, index).values()) { |
| 419 | if (HasAllocation(*value)) { |
| 420 | result.insert(GetAssignedAllocation(*value).GetSlice(*value)); |
| 421 | } |
| 422 | } |
| 423 | return result; |
| 424 | } |
| 425 | |
| 426 | const BufferAllocation& BufferAssignment::GetAllocation( |
| 427 | BufferAllocation::Index index) const { |