Enable to check operand status in pureacl (#2438)
author남궁석/동작제어Lab(SR)/Engineer/삼성전자 <sk.namkoong@samsung.com>
Fri, 12 Oct 2018 06:37:59 +0000 (15:37 +0900)
committer오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Fri, 12 Oct 2018 06:37:59 +0000 (15:37 +0900)
This commit will enable to check if operand exists or not

Signed-off-by: Seok NamKoong <sk.namkoong@samsung.com>
runtimes/pure_arm_compute/src/internal/Model.cc
runtimes/pure_arm_compute/src/internal/Model.h

index 3a31f99..b436d71 100644 (file)
@@ -120,6 +120,11 @@ const Object &Set::at(const Index &index) const { return *(_objects.at(index.asI
 
 Object &Set::at(const Index &index) { return *(_objects.at(index.asInt())); }
 
+bool Set::exist(const Index &index) const
+{
+  return index.asInt() >= 0 && index.asInt() < _objects.size();
+}
+
 } // namespace operand
 } // namespace tflite
 } // namespace internal
index 33ba3a8..df07203 100644 (file)
@@ -237,6 +237,7 @@ public:
   const Object &at(const Index &) const;
   Object &at(const Index &);
   size_t size(void) const { return _objects.size(); }
+  bool exist(const Index &) const;
 
 private:
   std::vector<std::unique_ptr<Object>> _objects;