[neurun] Add const iterate method to Linear (#3547)
author이한종/동작제어Lab(SR)/Engineer/삼성전자 <hanjoung.lee@samsung.com>
Tue, 13 Nov 2018 01:51:04 +0000 (10:51 +0900)
committer박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Tue, 13 Nov 2018 01:51:04 +0000 (10:51 +0900)
Add const iterate method to Linear

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

index 59a0050..2f97731 100644 (file)
@@ -184,5 +184,13 @@ backend::TensorBuilderSet Linear::planTensors()
   return tensor_builders;
 }
 
+void Linear::iterate(const std::function<void(const graph::operation::Node *)> &fn) const
+{
+  for (const auto op : _operations)
+  {
+    fn(op);
+  }
+}
+
 } // namespace linear
 } // namespace neurun
index 16ef785..42a314e 100644 (file)
@@ -60,6 +60,8 @@ public:
   // TODO Should not return TensorBuilderSet
   backend::TensorBuilderSet planTensors();
 
+  void iterate(const std::function<void(const graph::operation::Node *)> &fn) const;
+
 private:
   const graph::Graph &_graph;
   std::vector<const graph::operation::Node *> _operations;