From: 박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 Date: Fri, 20 Jul 2018 05:39:29 +0000 (+0900) Subject: [coco] Add 'Output' class (#735) X-Git-Tag: nncc_backup~2365 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=65e79ea610025b1bbfe54eba1bccb368213ccdb1;p=platform%2Fcore%2Fml%2Fnnfw.git [coco] Add 'Output' class (#735) This commit adds 'Output' class which records informations related with a network's output. Signed-off-by: Jonghyun Park --- diff --git a/contrib/coco/core/include/coco/IR/Output.h b/contrib/coco/core/include/coco/IR/Output.h new file mode 100644 index 0000000..19bcc9c --- /dev/null +++ b/contrib/coco/core/include/coco/IR/Output.h @@ -0,0 +1,23 @@ +#ifndef __COCO_IR_OUTPUT_H__ +#define __COCO_IR_OUTPUT_H__ + +#include + +namespace coco +{ + +class Output +{ +public: + Output(const nncc::core::ADT::tensor::Shape &shape); + +public: + const nncc::core::ADT::tensor::Shape &shape(void) const { return _shape; } + +private: + nncc::core::ADT::tensor::Shape const _shape; +}; + +} // namespace coco + +#endif // __COCO_IR_OUTPUT_H__ diff --git a/contrib/coco/core/src/IR/Output.cpp b/contrib/coco/core/src/IR/Output.cpp new file mode 100644 index 0000000..65ca955 --- /dev/null +++ b/contrib/coco/core/src/IR/Output.cpp @@ -0,0 +1,11 @@ +#include "coco/IR/Output.h" + +namespace coco +{ + +Output::Output(const nncc::core::ADT::tensor::Shape &shape) : _shape{shape} +{ + // DO NOTHING +} + +} // namespace coco diff --git a/contrib/coco/core/src/IR/Output.test.cpp b/contrib/coco/core/src/IR/Output.test.cpp new file mode 100644 index 0000000..23b7a4a --- /dev/null +++ b/contrib/coco/core/src/IR/Output.test.cpp @@ -0,0 +1,11 @@ +#include "coco/IR/Output.h" + +#include + +TEST(IR_OUTPUT, ctor_should_set_shape) +{ + const nncc::core::ADT::tensor::Shape shape{1, 3, 3, 1}; + coco::Output output{shape}; + + ASSERT_EQ(output.shape(), shape); +}