MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / SetFuseRecvAttrs

Function SetFuseRecvAttrs

tensorflow/core/graph/graph_partition.cc:181–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179}
180
181void 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
212NodeDef* AddSend(const PartitionOptions& opts, const GraphInfo& g_info,
213 GraphDef* gdef, const Edge* edge,

Callers 1

AddFuseRecvFunction · 0.85

Calls 7

nameMethod · 0.65
StrCatFunction · 0.50
sizeMethod · 0.45
idMethod · 0.45
srcMethod · 0.45
AttrMethod · 0.45
dstMethod · 0.45

Tested by

no test coverage detected