MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / ToString

Method ToString

tensorflow/compiler/xla/service/hlo_schedule.cc:311–337  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

309} // namespace
310
311string HloSchedule::ToString() const {
312 std::vector<string> pieces;
313
314 pieces.push_back("HloSchedule");
315 for (const auto& id_sequence : sequences_) {
316 const HloComputation* computation =
317 IdToComputation(module_, id_sequence.first);
318 if (computation == nullptr) {
319 // The computation is not in the module and may have been deleted so it is
320 // not safe to dereference any HLO pointers. Just use the HLO unique ids
321 // stored in this object.
322 pieces.push_back(
323 absl::StrFormat("computation with id %d (no longer in HLO module):",
324 id_sequence.first));
325 for (int id : id_sequence.second.ids()) {
326 pieces.push_back(absl::StrCat(" ", id));
327 }
328 } else {
329 pieces.push_back(absl::StrFormat("computation %s:", computation->name()));
330 for (const HloInstruction* instruction :
331 id_sequence.second.instructions()) {
332 pieces.push_back(absl::StrCat(" ", instruction->name()));
333 }
334 }
335 }
336 return absl::StrJoin(pieces, "\n");
337}
338
339std::ostream& operator<<(std::ostream& out, const HloSchedule& schedule) {
340 out << schedule.ToString();

Callers 1

hlo_schedule.ccFile · 0.45

Calls 6

IdToComputationFunction · 0.85
idsMethod · 0.80
instructionsMethod · 0.80
nameMethod · 0.65
StrCatFunction · 0.50
push_backMethod · 0.45

Tested by

no test coverage detected