[neurun] Fix when `Graph::lower` is called twice (#4263)
author이한종/On-Device Lab(SR)/Engineer/삼성전자 <hanjoung.lee@samsung.com>
Fri, 18 Jan 2019 00:46:44 +0000 (09:46 +0900)
committer박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Fri, 18 Jan 2019 00:46:44 +0000 (09:46 +0900)
This commit fixes to handle `Graph::lower` is called multiple times.

Fix #4258

Signed-off-by: Hanjoung Lee <hanjoung.lee@samsung.com>
runtimes/neurun/src/graph/Graph.cc

index dc35efa..0de0fa4 100644 (file)
@@ -105,6 +105,11 @@ void Graph::lower(void)
 
     _backend_resolver = nnfw::cpp14::make_unique<compiler::BackendResolver>(_model->operands);
 
+    // NOTE This is a workaround when `lower` is called many times
+    // TODO Introduce a class that represents Lowered Graph
+    _operation_lower_info.clear();
+    _operand_lower_info.clear();
+
     _model->operations.iterate(
         [&](const model::operation::Index &index, model::operation::Node &node) {
           auto backend = _backend_resolver->getBackend(typeid(node));