[neurun] Add remove() for operand::Set and operation::Set and Graph (#3678)
authorДилшоджон Умронхонович Пошшоев/AI Tools Lab /SRR/Engineer/삼성전자 <d.poshshoev@samsung.com>
Fri, 23 Nov 2018 00:58:41 +0000 (03:58 +0300)
committer오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Fri, 23 Nov 2018 00:58:41 +0000 (09:58 +0900)
These changes are needed to remove some layers from a graph

Signed-off-by: Poshshoev Dilshodzhon <d.poshshoev@samsung.com>
runtimes/neurun/src/graph/Graph.h
runtimes/neurun/src/graph/operand/Set.h
runtimes/neurun/src/graph/operation/Set.h

index 0e9029e..2fc42a9 100644 (file)
@@ -105,6 +105,7 @@ public:
   void addOutput(const operand::Index &ind);
   void finishBuilding(void);
   void lower(void);
+  void removeOperand(const operand::Index &ind) { _model->operands.remove(ind); }
   std::unique_ptr<linear::Linear> linearize(void);
   bool isBuildingPhase(void) const { return _phase == Phase::BUILDING; }
   bool isLowered(void) const { return _phase == Phase::LOWERED; }
index c8266fe..fefb964 100644 (file)
@@ -37,6 +37,7 @@ public:
 
 public:
   Index append(const Shape &, const TypeInfo &);
+  void remove(const Index &index) { _objects.erase(index); };
 
 public:
   const Object &at(const Index &) const;
index bc6913f..60d4575 100644 (file)
@@ -38,6 +38,7 @@ public:
 
 public:
   Index append(std::unique_ptr<Node> &&node);
+  void remove(const Index &index) { _nodes.erase(index); };
 
 public:
   const Node &at(const Index &) const;