[enco] Introduce setOperand for non-scalar values (#1229)
author박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Wed, 29 Aug 2018 06:09:21 +0000 (15:09 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Wed, 29 Aug 2018 06:09:21 +0000 (15:09 +0900)
This commit introduces overloaded setOperand method which takes non-scalar
(array) values.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
contrib/enco/core/src/ANN/Binder.h

index ef58d51..16b69e5 100644 (file)
@@ -87,6 +87,14 @@ public:
     _module->operand()->at(id)->weight(weight);
   }
 
+  // @brief Set non-scalar weight
+  template <typename It> void setOperand(const ann::OperandID &id, It beg, It end)
+  {
+    auto weight = _module->weight()->create();
+    weight->fill(beg, end);
+    _module->operand()->at(id)->weight(weight);
+  }
+
 public:
   void addOperation(ann::Operation::Code code, std::initializer_list<ann::OperandID> inputs,
                     std::initializer_list<ann::OperandID> outputs)