53 std::stack<NodeState>
stack;
54 stack.push({
node,
nullptr, 0});
55 Node* early_schedule_position =
nullptr;
56 while (!stack.empty()) {
61 }
else if (top.node->InputCount() == 0) {
67 if (top.input_index == top.node->InputCount()) {
69 early_schedule_position = top.early_schedule_position;
73 Node* input_early_schedule_position =
nullptr;
75 input_early_schedule_position = input;
79 input_early_schedule_position = early_pos_it->second;
82 if (input_early_schedule_position !=
nullptr) {
83 if (top.early_schedule_position ==
nullptr ||
86 top.early_schedule_position = input_early_schedule_position;
91 stack.push({input,
nullptr, 0});
102 if (!stack.empty()) {
104 if (use.early_schedule_position ==
nullptr ||
107 use.early_schedule_position = early_schedule_position;
112 DCHECK(early_schedule_position !=
nullptr);
113 return early_schedule_position;