| 252 | } |
| 253 | |
| 254 | Status LowerWhileHelper::CreateCondFuncCallNode() { |
| 255 | for (Node* merge_node : merge_nodes_) { |
| 256 | cond_call_builder_.Input(NodeOut(merge_node, 0)); |
| 257 | } |
| 258 | cond_call_builder_.Device(while_op_->requested_device()); |
| 259 | TF_RETURN_IF_ERROR(cond_call_builder_.Finalize(graph_, &cond_call_node_)); |
| 260 | // Add a control edge to make sure the Const nodes in the cond function |
| 261 | // are in the same frame as the rest of the function, otherwise |
| 262 | // `BuildControlFlowInfo` throws an error. |
| 263 | graph_->AddControlEdge(merge_nodes_[0], cond_call_node_); |
| 264 | TF_RETURN_IF_ERROR(NodeBuilder(NewName("LoopCond"), "LoopCond", |
| 265 | graph_->op_registry(), &debug_info_) |
| 266 | .Input(NodeOut(cond_call_node_, 0)) |
| 267 | .Device(while_op_->requested_device()) |
| 268 | .Finalize(graph_, &loop_cond_node_)); |
| 269 | return Status::OK(); |
| 270 | } |
| 271 | |
| 272 | Status LowerWhileHelper::CreateSwitchNodes() { |
| 273 | for (int i = 0; i < num_loop_inputs_; i++) { |
nothing calls this directly
no test coverage detected