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

Method ToString

tensorflow/compiler/xla/service/hlo_dataflow_analysis.cc:147–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145}
146
147string HloDataflowAnalysis::ToString() const {
148 string out = StrCat("HloDataflowAnalysis, module ", module_.name(), "\n");
149 StrAppend(&out, " Instruction value sets:\n");
150 for (const HloComputation* computation : module_.computations()) {
151 for (const HloInstruction* instruction : computation->instructions()) {
152 StrAppend(&out, "Instruction: \n ", instruction->name(), ":\n");
153 if (instruction->shape().IsTuple()) {
154 GetInstructionValueSet(instruction)
155 .ForEachElement([this, &instruction, &out](
156 const ShapeIndex& index,
157 const HloValueSet& value_set) {
158 StrAppend(&out, " tuple index ", index.ToString(), ":\n");
159 for (const HloValue* value : value_set.values()) {
160 StrAppend(&out, " ", value->ToShortString(),
161 ValueIsDefinedAt(instruction, index) ? " (def)" : "",
162 "\n");
163 }
164 });
165 } else {
166 const HloValueSet& top_level_value_set =
167 GetValueSet(instruction, /*index=*/{});
168 for (const HloValue* value : top_level_value_set.values()) {
169 StrAppend(&out, " ", value->ToShortString(),
170 ValueIsDefinedAt(instruction) ? " (def)" : "", "\n");
171 }
172 }
173 }
174 }
175 StrAppend(&out, " HloValues:\n");
176 for (const HloValue* value : values()) {
177 StrAppend(&out, value->ToString(/*indent=*/4));
178 }
179 return out;
180}
181
182bool HloDataflowAnalysis::Phi(
183 HloInstruction* instruction,

Callers 4

PhiMethod · 0.45
RunMethod · 0.45

Calls 10

computationsMethod · 0.80
instructionsMethod · 0.80
nameMethod · 0.65
StrCatFunction · 0.50
StrAppendFunction · 0.50
IsTupleMethod · 0.45
shapeMethod · 0.45
ForEachElementMethod · 0.45
valuesMethod · 0.45
ToShortStringMethod · 0.45

Tested by

no test coverage detected