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

Method ToString

tensorflow/compiler/xla/service/hlo_alias_analysis.cc:453–488  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

451}
452
453string HloAliasAnalysis::ToString() const {
454 string out = absl::StrCat("HloAliasAnalysis, module ", module_->name(), "\n");
455 StrAppend(&out, " Buffers at each position:\n");
456 for (const HloComputation* computation : module_->computations()) {
457 for (const HloInstruction* instruction : computation->instructions()) {
458 StrAppend(&out, " ", instruction->name(), ":\n");
459 if (instruction->shape().IsTuple()) {
460 ShapeUtil::ForEachSubshape(
461 instruction->shape(),
462 [&out, &instruction, this](const Shape&, const ShapeIndex& index) {
463 StrAppend(&out, " tuple index ", index.ToString(), ":\n");
464 for (const HloBuffer* buffer :
465 ComputeBuffersAt(instruction, index)) {
466 StrAppend(&out, " ", buffer->ToString(), "\n");
467 }
468 });
469 } else {
470 for (const HloBuffer* buffer :
471 ComputeBuffersAt(instruction, /*index=*/{})) {
472 StrAppend(&out, " ", buffer->ToString(), "\n");
473 }
474 }
475 }
476 }
477
478 StrAppend(&out, " Buffers:\n");
479 for (const HloBuffer& buffer : buffers()) {
480 StrAppend(&out, " ", buffer.ToString(), "\n");
481 StrAppend(&out, " positions:\n");
482 for (const HloPosition& position : buffer.ComputePositions()) {
483 StrAppend(&out, " ", position.ToString(), "\n");
484 }
485 }
486
487 return out;
488}
489
490/* static */
491StatusOr<std::unique_ptr<HloAliasAnalysis>> HloAliasAnalysis::Run(

Callers 2

RunMethod · 0.45
MergeBuffersMethod · 0.45

Calls 9

buffersFunction · 0.85
computationsMethod · 0.80
instructionsMethod · 0.80
ComputePositionsMethod · 0.80
nameMethod · 0.65
StrCatFunction · 0.50
StrAppendFunction · 0.50
IsTupleMethod · 0.45
shapeMethod · 0.45

Tested by

no test coverage detected