This commit will enable to check if operand exists or not
Signed-off-by: Seok NamKoong <sk.namkoong@samsung.com>
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
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;