| 146 | } |
| 147 | |
| 148 | void SetInput(NodeDef* dst, int dst_slot, |
| 149 | StringPiece src_name, int src_slot) { |
| 150 | if (src_slot == Graph::kControlSlot) { |
| 151 | dst->set_input(dst_slot, strings::StrCat("^", src_name)); |
| 152 | } else if (src_slot == 0) { |
| 153 | dst->set_input(dst_slot, src_name.data(), src_name.size()); |
| 154 | } else { |
| 155 | dst->set_input(dst_slot, strings::StrCat(src_name, ":", src_slot)); |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | // Add a control edge from each input to each recv. |
| 160 | void AddReadControl(const std::vector<NodeDef*>& recvs, |