| 254 | } |
| 255 | |
| 256 | void 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 |
| 280 | const string DebugNodeInserter::GetCopyNodeName(const string& node_name, |