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

Method Run

tensorflow/compiler/xla/service/conditional_to_select.cc:65–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65StatusOr<bool> ConditionalToSelect::Run(HloModule* module) {
66 std::unique_ptr<CallGraph> call_graph = CallGraph::Build(module);
67 bool did_mutate = false;
68 VLOG(1) << "Running conditional-to-select pass";
69 TF_RETURN_IF_ERROR(
70 call_graph->VisitNodes([&](const CallGraphNode& node) -> Status {
71 std::vector<HloInstruction*> ToInline;
72 if (node.context() != CallContext::kParallel) {
73 return Status::OK();
74 }
75 for (const CallSite& callsite : node.callsites()) {
76 if (callsite.instruction()->opcode() == HloOpcode::kConditional) {
77 VLOG(1) << "Visiting conditional: " << callsite.ToString();
78 HloInstruction* conditional = callsite.instruction();
79 TF_ASSIGN_OR_RETURN(bool result,
80 DoConditionalToSelect(conditional));
81 did_mutate |= result;
82 }
83 }
84 return Status::OK();
85 }));
86 return did_mutate;
87}
88
89} // namespace xla

Callers

nothing calls this directly

Calls 5

VisitNodesMethod · 0.80
opcodeMethod · 0.80
contextMethod · 0.45
instructionMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected