From: 이한종/동작제어Lab(SR)/Engineer/삼성전자 Date: Thu, 6 Sep 2018 08:24:01 +0000 (+0900) Subject: [neurun] Add basic methods to LayoutSet (#2623) X-Git-Tag: 0.2~66 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a5b84aa4d27f225e30edd2d5954582d4015837aa;p=platform%2Fcore%2Fml%2Fnnfw.git [neurun] Add basic methods to LayoutSet (#2623) Introduce `contains` and `size` method for user queries. Signed-off-by: Hanjoung Lee --- diff --git a/runtimes/neurun/src/graph/operand/LayoutSet.h b/runtimes/neurun/src/graph/operand/LayoutSet.h index 27a5c7f..1468b28 100644 --- a/runtimes/neurun/src/graph/operand/LayoutSet.h +++ b/runtimes/neurun/src/graph/operand/LayoutSet.h @@ -22,6 +22,8 @@ public: public: void add(const Layout &layout) { _set.insert(layout); } void remove(const Layout &layout) { _set.erase(layout); } + uint32_t size() const { return static_cast(_set.size()); } + bool contains(const Layout &layout) const { return _set.find(layout) != _set.end(); } public: std::unordered_set::const_iterator begin() const { return _set.begin(); }