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

Method DeparallelizeWhileLoops

tensorflow/core/debug/debug_graph_utils.cc:256–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254}
255
256void DebugNodeInserter::DeparallelizeWhileLoops(Graph* graph, Device* device) {
257 bool deparallelized_a_loop = false;
258 for (Node* node : graph->nodes()) {
259 if (node->IsEnter()) {
260 const AttrValue* parallel_iterations =
261 node->attrs().Find("parallel_iterations");
262 if (parallel_iterations && parallel_iterations->i() > 1) {
263 deparallelized_a_loop = true;
264 VLOG(1) << "Changing the parallel_iterations attribute of the "
265 << "Enter/RefEnter node \"" << node->name() << "\" on device \""
266 << device->name() << "\" from " << parallel_iterations->i()
267 << " to 1.";
268 node->AddAttr<int64>("parallel_iterations", 1);
269 }
270 }
271 }
272 if (deparallelized_a_loop) {
273 LOG(INFO) << "For debugging, tfdbg has set the parallel_iterations "
274 << "attribute of all scheduled Enter/RefEnter nodes to 1. (This "
275 << "does not affect subsequent non-debug runs.)";
276 }
277}
278
279// static
280const string DebugNodeInserter::GetCopyNodeName(const string& node_name,

Callers

nothing calls this directly

Calls 6

IsEnterMethod · 0.80
nameMethod · 0.65
nodesMethod · 0.45
FindMethod · 0.45
attrsMethod · 0.45
iMethod · 0.45

Tested by

no test coverage detected