| 97 | }; |
| 98 | |
| 99 | CaseBuilder::CaseBuilder(Node* case_op, |
| 100 | const std::vector<string>& branch_fn_names, |
| 101 | bool keep_node_fetchable, Graph* graph) |
| 102 | : case_op_(case_op), |
| 103 | num_branches_(branch_fn_names.size()), |
| 104 | graph_(graph), |
| 105 | name_(case_op->name()), |
| 106 | keep_node_fetchable_(keep_node_fetchable), |
| 107 | debug_info_(*case_op_) { |
| 108 | branch_call_builders_.reserve(num_branches_); |
| 109 | for (int b = 0; b < num_branches_; b++) { |
| 110 | branch_call_builders_.emplace_back(NewName(strings::StrCat("branch", b)), |
| 111 | branch_fn_names[b], graph->op_registry(), |
| 112 | &debug_info_); |
| 113 | branch_call_builders_[b].Device(case_op_->requested_device()); |
| 114 | branch_call_builders_[b].Attr(kLowerAsMultiDeviceFunctionAttr, true); |
| 115 | } |
| 116 | TF_CHECK_OK(case_op_->input_tensor(0, &branch_index_)); |
| 117 | } |
| 118 | |
| 119 | Status CaseBuilder::CreatePivotNodes() { |
| 120 | // Construct the basic case body (consisting of feeding in the val to |
nothing calls this directly
no test coverage detected