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

Function FindInstruction

tensorflow/compiler/xla/tools/interactive_graphviz.cc:118–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116bool show_backend_config = true;
117
118HloInstruction* FindInstruction(const HloModule& module, string node_name) {
119 if (absl::StartsWith(node_name, "%")) {
120 node_name.erase(node_name.begin());
121 }
122 for (const auto& computation : module.computations()) {
123 auto instrs = computation->instructions();
124 auto it = absl::c_find_if(instrs, [&](const HloInstruction* instr) {
125 // Try with and without "%" at the beginning of the node name.
126 return EqualsIgnoreCase(instr->name(), node_name) ||
127 EqualsIgnoreCase(instr->name(), absl::StrCat("%", node_name));
128 });
129 if (it != instrs.end()) {
130 return *it;
131 }
132 }
133 return nullptr;
134}
135
136HloComputation* FindComputation(const HloModule& module,
137 const string& comp_name) {

Callers 15

TEST_FFunction · 0.85
TEST_FFunction · 0.85
DoInfoCommandFunction · 0.85
DoExtractCommandFunction · 0.85
DoAllPathsCommandFunction · 0.85
DoPlotCommandFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85

Calls 8

StartsWithFunction · 0.85
computationsMethod · 0.80
instructionsMethod · 0.80
nameMethod · 0.65
StrCatFunction · 0.50
eraseMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by 14

TEST_FFunction · 0.68
TEST_FFunction · 0.68
TEST_FFunction · 0.68
TEST_FFunction · 0.68
TEST_FFunction · 0.68
TEST_FFunction · 0.68
TEST_FFunction · 0.68
TEST_FFunction · 0.68
LayoutOfMethod · 0.68
TEST_FFunction · 0.68
TEST_FFunction · 0.68
HasDomainEdgeMethod · 0.68