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

Function PushDFSChild

tensorflow/compiler/xla/service/hlo_instruction.cc:3040–3057  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3038// cycle was detected, and true otherwise.
3039template <typename Visitor>
3040inline bool PushDFSChild(Visitor* visitor, DFSStack* dfs_stack,
3041 HloInstruction* child) {
3042 CHECK(child != nullptr);
3043 const int id = child->unique_id();
3044 CHECK_GE(id, 0) << "instruction may not have a parent computation";
3045 switch (visitor->GetVisitState(id)) {
3046 case Visitor::kVisiting:
3047 return false;
3048
3049 case Visitor::kVisited:
3050 // Nothing to do
3051 return true;
3052
3053 case Visitor::kNotVisited:
3054 dfs_stack->push_back(std::make_pair(id, child));
3055 return true;
3056 }
3057}
3058
3059using InternalCompareFunction =
3060 std::function<bool(std::pair<int, const HloInstruction*>,

Callers 1

PostOrderDFSFunction · 0.85

Calls 3

unique_idMethod · 0.45
GetVisitStateMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected