From: 박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 Date: Tue, 11 Dec 2018 00:16:56 +0000 (+0900) Subject: [coco] Create BHWC FeatureLayout with FeatureShape (#2593) X-Git-Tag: nncc_backup~1123 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1f1ce45087be4773183713fe3853776917ca3fa9;p=platform%2Fcore%2Fml%2Fnnfw.git [coco] Create BHWC FeatureLayout with FeatureShape (#2593) This change allows users to create a BHWC FeatureLayout with non-singular batch dimension. Signed-off-by: Jonghyun Park --- diff --git a/contrib/coco/core/include/coco/IR/FeatureLayouts.h b/contrib/coco/core/include/coco/IR/FeatureLayouts.h index 8764f26..23b9c49 100644 --- a/contrib/coco/core/include/coco/IR/FeatureLayouts.h +++ b/contrib/coco/core/include/coco/IR/FeatureLayouts.h @@ -79,6 +79,7 @@ private: public: static std::unique_ptr create(const nncc::core::ADT::feature::Shape &shape); + static std::unique_ptr create(const FeatureShape &shape); }; /** diff --git a/contrib/coco/core/src/IR/FeatureLayouts.cpp b/contrib/coco/core/src/IR/FeatureLayouts.cpp index fde4b84..f4cfb96 100644 --- a/contrib/coco/core/src/IR/FeatureLayouts.cpp +++ b/contrib/coco/core/src/IR/FeatureLayouts.cpp @@ -93,6 +93,12 @@ std::unique_ptr BHWC::create(const nncc::core::ADT::feature::Shape &shape) return std::unique_ptr{new BHWC{FeatureShape{shape}}}; } +std::unique_ptr BHWC::create(const FeatureShape &shape) +{ + // NOTE It is impossible to use make_unique here as the constructor is private + return std::unique_ptr{new BHWC{shape}}; +} + } // namespace FeatureLayouts } // namespace coco