[Fix] change max order to point last
authorJihoon Lee <jhoon.it.lee@samsung.com>
Thu, 13 Jan 2022 15:22:29 +0000 (00:22 +0900)
committerJijoong Moon <jijoong.moon@samsung.com>
Wed, 19 Jan 2022 10:51:43 +0000 (19:51 +0900)
This patch fixes bug that gradient clipping was not applied correctly
when optimization is on.

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
nntrainer/graph/network_graph.cpp

index 911efec..a2f90ab 100644 (file)
@@ -411,8 +411,11 @@ void NetworkGraph::setMaxExecutionOrder(bool skip_optimize) {
         std::max(max_exec_order, std::get<1>(ln->getExecutionOrder()));
 #endif
     } else {
+      /// FIXME below code need explanation
+      //   max_exec_order =
+      //   std::max(max_exec_order, std::get<0>(ln->getExecutionOrder()));
       max_exec_order =
-        std::max(max_exec_order, std::get<0>(ln->getExecutionOrder()));
+        std::max(max_exec_order, std::get<2>(ln->getExecutionOrder()));
     }
   }
 }