[neurun] Fix TensorBuilder to add subtensors to Plan::operands (#3614)
authorДилшоджон Умронхонович Пошшоев/AI Tools Lab /SRR/Engineer/삼성전자 <d.poshshoev@samsung.com>
Tue, 20 Nov 2018 07:19:00 +0000 (10:19 +0300)
committer오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Tue, 20 Nov 2018 07:19:00 +0000 (16:19 +0900)
Fix TensorBuilder to add subtensors to Plan::operands
Related issue is #3611

Signed-off-by: Poshshoev Dilshodzhon <d.poshshoev@samsung.com>
runtimes/neurun/src/backend/acl_cl/TensorBuilder.cc

index d591a36..dc5a64a 100644 (file)
@@ -178,7 +178,14 @@ std::shared_ptr<::arm_compute::ITensor> TensorBuilder::tensorAt(const graph::ope
 std::shared_ptr<backend::operand::IObject>
 TensorBuilder::wrapTensor(const graph::operand::Index &ind)
 {
-  return std::make_shared<operand::Object>(_tensors.at(ind));
+  if (_tensors.find(ind) != _tensors.end())
+  {
+    return std::make_shared<operand::Object>(_tensors.at(ind));
+  }
+  else
+  {
+    return std::make_shared<operand::Object>(_subtensors.at(ind));
+  }
 }
 
 void TensorBuilder::iterate(const IterateFunction &fn)
@@ -187,6 +194,10 @@ void TensorBuilder::iterate(const IterateFunction &fn)
   {
     fn(it.first);
   }
+  for (auto it : _subtensors)
+  {
+    fn(it.first);
+  }
 }
 
 std::shared_ptr<::arm_compute::ICLTensor>