[neurun] Replace IExecutor::model with IExecutor::graph (#9286)
authorSergei Barannikov/AI Tools Lab /SRR/Engineer/Samsung Electronics <s.barannikov@samsung.com>
Fri, 29 Nov 2019 06:59:45 +0000 (09:59 +0300)
committer이한종/On-Device Lab(SR)/Engineer/삼성전자 <hanjoung.lee@samsung.com>
Fri, 29 Nov 2019 06:59:45 +0000 (15:59 +0900)
Replace IExecutor::model (returning Model) with IExecutor::graph, which returns graph. Do the same in derived classes also.

Signed-off-by: Sergei Barannikov <s.barannikov@samsung.com>
runtime/neurun/core/include/exec/Execution.h
runtime/neurun/core/include/exec/IExecutor.h
runtime/neurun/core/src/exec/Execution.cc
runtime/neurun/core/src/exec/ExecutionObservers.cc
runtime/neurun/core/src/exec/ExecutorBase.h
runtime/neurun/core/src/exec/interp/ExecManager.h

index d336633..b23841f 100644 (file)
@@ -51,7 +51,7 @@ public:
    * @brief   Returns model object
    * @return  Model object
    */
-  const model::Model &model() const { return _executor->model(); }
+  const model::Model &model() const { return *_executor->graph().shareModel(); }
   /**
    * @brief     Set input data's information
    * @param[in] index   Input index
index eb4f5e3..bf83761 100644 (file)
@@ -21,7 +21,7 @@
 #ifndef __NEURUN_EXEC_I_EXECUTOR_H_
 #define __NEURUN_EXEC_I_EXECUTOR_H_
 
-#include "model/Model.h"
+#include "graph/Graph.h"
 #include "IFunction.h"
 #include "IODescription.h"
 #include "model/OperationIndexMap.h"
@@ -46,11 +46,11 @@ struct IExecutor
   virtual ~IExecutor() = default;
 
   /**
-   * @brief Returns model object
+   * @brief Returns graph object
    *
-   * @return Model object
+   * @return Graph object
    */
-  virtual const model::Model &model() = 0;
+  virtual const graph::Graph &graph() = 0;
 
   /**
    * @brief     Set an ordering on operations
index d61fa71..29eb7c7 100644 (file)
@@ -25,8 +25,8 @@ namespace exec
 
 Execution::Execution(const std::shared_ptr<IExecutor> &executor) : _executor{executor}
 {
-  _io_desc.inputs.resize(_executor->model().inputs.size());
-  _io_desc.outputs.resize(_executor->model().outputs.size());
+  _io_desc.inputs.resize(_executor->graph().getInputs().size());
+  _io_desc.outputs.resize(_executor->graph().getOutputs().size());
 }
 
 // TODO Remove default parameter
index 2a806e5..894b3e0 100644 (file)
@@ -51,17 +51,17 @@ void ProfileObserver::handleEnd(IExecutor *exec, const model::Subgraph *subgraph
   VERBOSE(ProfileInfo) << "Time for " << node_name << " : " << timer_res << std::endl;
 
   // fill ExecTime:
-  bool is_quantized = exec->model().operands.at(node->getInputs().at(0)).typeInfo().type() ==
+  bool is_quantized = exec->graph().operands().at(node->getInputs().at(0)).typeInfo().type() ==
                       model::DataType::QUANT8_ASYMM;
 
   uint32_t size = 0;
   for (const auto &input : node->getInputs())
   {
-    size += exec->model().operands.at(input).info().total_size();
+    size += exec->graph().operands().at(input).info().total_size();
   }
   for (const auto &output : node->getOutputs())
   {
-    size += exec->model().operands.at(output).info().total_size();
+    size += exec->graph().operands().at(output).info().total_size();
   }
   if (node_name == "Permute")
   {
index 551ac0a..00f1f34 100644 (file)
@@ -48,7 +48,7 @@ public:
 
   virtual ~ExecutorBase() = default;
 
-  const model::Model &model() override { return *_graph.shareModel(); }
+  const graph::Graph &graph() final { return _graph; }
 
   void execute(const IODescription &desc) final;
 
index 53a5316..a039797 100644 (file)
@@ -46,10 +46,10 @@ public:
 
 public:
   /**
-   * @brief   Return graph model
-   * @return  Graph model
+   * @brief   Return graph object
+   * @return  Graph object
    */
-  const model::Model &model() override { return *_graph.shareModel(); }
+  const graph::Graph &graph() final { return _graph; }
   void setIndexedRanks(std::shared_ptr<model::OperationIndexMap<int64_t>>) override{
       // Not implemented
   };