From: 이한종/동작제어Lab(SR)/Engineer/삼성전자 Date: Mon, 3 Sep 2018 01:11:37 +0000 (+0900) Subject: [neurun] Make initializeUseDef less verbose (#2546) X-Git-Tag: 0.2~120 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f5e7951ad61310dc1c59f571941184f9203df3ff;p=platform%2Fcore%2Fml%2Fnnfw.git [neurun] Make initializeUseDef less verbose (#2546) Make `Graph::initializeUseDef` implementation less verbose via using directly a lambda function. Signed-off-by: Hanjoung Lee --- diff --git a/runtimes/neurun/src/graph/Graph.cc b/runtimes/neurun/src/graph/Graph.cc index 4ed9c42..5db6e5c 100644 --- a/runtimes/neurun/src/graph/Graph.cc +++ b/runtimes/neurun/src/graph/Graph.cc @@ -140,9 +140,7 @@ std::unique_ptr Graph::linearize(void) void Graph::initializeUseDef() { - std::function initUseDef = - [&](const operation::Index &index, const operation::Node &node) -> void { - + operations().iterate([&](const operation::Index &index, const operation::Node &node) -> void { auto outputs = node.getOutputs(); for (auto output : outputs.list()) { @@ -154,9 +152,7 @@ void Graph::initializeUseDef() { operands().at(input).appendUse(index); } - }; - - operations().iterate(initUseDef); + }); } } // namespace graph