| 180 | } |
| 181 | |
| 182 | Status CondBuilder::AddInputs() { |
| 183 | // Add input data edges. |
| 184 | std::vector<const Edge*> edges; |
| 185 | TF_RETURN_IF_ERROR(if_op_->input_edges(&edges)); |
| 186 | // Start at index 1 as the first input is the predicate. |
| 187 | for (int i = 1; i < edges.size(); ++i) { |
| 188 | const Edge* e = edges[i]; |
| 189 | TF_RETURN_IF_ERROR(AddInput(e->src(), e->src_output())); |
| 190 | } |
| 191 | // Add input control edges. |
| 192 | for (const Edge* e : if_op_->in_edges()) { |
| 193 | if (e->IsControlEdge()) { |
| 194 | graph_->AddControlEdge(e->src(), control_predecessor_); |
| 195 | } |
| 196 | } |
| 197 | return Status::OK(); |
| 198 | } |
| 199 | |
| 200 | Status CondBuilder::AddOutputs() { |
| 201 | // Construct the then and else nodes. |
no test coverage detected