| 179 | } |
| 180 | |
| 181 | void SetFuseRecvAttrs(const PartitionOptions& opts, |
| 182 | const std::vector<const Edge*>& edges, |
| 183 | NodeDefBuilder* builder) { |
| 184 | |
| 185 | int fuse_count = edges.size(); |
| 186 | |
| 187 | // Set tensor names. |
| 188 | std::vector<string> tensor_names(fuse_count); |
| 189 | for (int i = 0; i < fuse_count; ++i) { |
| 190 | tensor_names[i] = strings::StrCat("edge_", edges[i]->id(), "_", |
| 191 | edges[i]->src()->name()); |
| 192 | } |
| 193 | builder->Attr("tensor_names", tensor_names); |
| 194 | |
| 195 | std::vector<string> send_devices(fuse_count); |
| 196 | std::vector<string> recv_devices(fuse_count); |
| 197 | std::vector<int64> send_device_incarnations(fuse_count); |
| 198 | for (int i = 0; i < fuse_count; ++i) { |
| 199 | send_devices[i] = edges[i]->src()->assigned_device_name(); |
| 200 | recv_devices[i] = edges[i]->dst()->assigned_device_name(); |
| 201 | send_device_incarnations[i] = |
| 202 | static_cast<int64>(opts.get_incarnation( |
| 203 | edges[i]->src()->assigned_device_name())); |
| 204 | } |
| 205 | builder->Attr("send_devices", send_devices); |
| 206 | builder->Attr("recv_devices", recv_devices); |
| 207 | builder->Attr("send_device_incarnations", send_device_incarnations); |
| 208 | |
| 209 | builder->Attr("client_terminated", false); |
| 210 | } |
| 211 | |
| 212 | NodeDef* AddSend(const PartitionOptions& opts, const GraphInfo& g_info, |
| 213 | GraphDef* gdef, const Edge* edge, |