From ea16032519f776725854d5d4fce408eca6fccebb Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=98=A4=ED=98=95=EC=84=9D/=EB=8F=99=EC=9E=91=EC=A0=9C?= =?utf8?q?=EC=96=B4Lab=28SR=29/Staff=20Engineer/=EC=82=BC=EC=84=B1?= =?utf8?q?=EC=A0=84=EC=9E=90?= Date: Wed, 22 Aug 2018 08:36:20 +0900 Subject: [PATCH] [neurun] Simplify namespace for operand (#2381) Simplify namespace for operand internal data structure - Use alias for internal - Use relative namespace Signed-off-by: Hyeongseok Oh --- runtimes/neurun/src/graph/operand/IndexSet.h | 5 +---- runtimes/neurun/src/graph/operand/Set.cc | 14 ++++---------- runtimes/neurun/src/graph/operand/Set.h | 13 +++++++++---- 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/runtimes/neurun/src/graph/operand/IndexSet.h b/runtimes/neurun/src/graph/operand/IndexSet.h index 5deb805..b7379a1 100644 --- a/runtimes/neurun/src/graph/operand/IndexSet.h +++ b/runtimes/neurun/src/graph/operand/IndexSet.h @@ -26,10 +26,7 @@ public: public: uint32_t size() const { return static_cast(_set.size()); } const std::vector &list() const { return _set; } - const Index &at(::neurun::graph::operand::IO::Index set_index) const - { - return _set.at(set_index.asInt()); - } + const Index &at(IO::Index set_index) const { return _set.at(set_index.asInt()); } private: std::vector _set; diff --git a/runtimes/neurun/src/graph/operand/Set.cc b/runtimes/neurun/src/graph/operand/Set.cc index 5793c6b..7c68120 100644 --- a/runtimes/neurun/src/graph/operand/Set.cc +++ b/runtimes/neurun/src/graph/operand/Set.cc @@ -7,24 +7,18 @@ namespace graph namespace operand { -Index Set::append(const ::neurun::internal::operand::Shape &shape) +Index Set::append(const internal::Shape &shape) { uint32_t index = _objects.size(); - _objects.emplace_back(new ::neurun::internal::operand::Object{shape}); + _objects.emplace_back(new internal::Object{shape}); return Index{index}; } -const ::neurun::internal::operand::Object &Set::at(const Index &index) const -{ - return *(_objects.at(index.asInt())); -} +const internal::Object &Set::at(const Index &index) const { return *(_objects.at(index.asInt())); } -::neurun::internal::operand::Object &Set::at(const Index &index) -{ - return *(_objects.at(index.asInt())); -} +internal::Object &Set::at(const Index &index) { return *(_objects.at(index.asInt())); } bool Set::exist(const Index &index) const { return index.asInt() < _objects.size(); } diff --git a/runtimes/neurun/src/graph/operand/Set.h b/runtimes/neurun/src/graph/operand/Set.h index ba0ab5c..d900839 100644 --- a/runtimes/neurun/src/graph/operand/Set.h +++ b/runtimes/neurun/src/graph/operand/Set.h @@ -14,21 +14,26 @@ namespace graph namespace operand { +namespace +{ +namespace internal = ::neurun::internal::operand; +} + class Set { public: Set() = default; public: - Index append(const ::neurun::internal::operand::Shape &); + Index append(const internal::Shape &); public: - const ::neurun::internal::operand::Object &at(const Index &) const; - ::neurun::internal::operand::Object &at(const Index &); + const internal::Object &at(const Index &) const; + internal::Object &at(const Index &); bool exist(const Index &) const; private: - std::vector> _objects; + std::vector> _objects; }; } // namespace operand -- 2.7.4