From e1b320bc70e365b1f1dff2262efaa4e375ffb518 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EB=B0=95=EC=A2=85=ED=98=84/=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: Fri, 20 Jul 2018 14:39:37 +0900 Subject: [PATCH] [coco] Add 'Input' class (#734) This commit add 'Input' class which records input-related information. Signed-off-by: Jonghyun Park --- contrib/coco/core/include/coco/IR/Input.h | 23 +++++++++++++++++++++++ contrib/coco/core/src/IR/Input.cpp | 11 +++++++++++ contrib/coco/core/src/IR/Input.test.cpp | 11 +++++++++++ 3 files changed, 45 insertions(+) create mode 100644 contrib/coco/core/include/coco/IR/Input.h create mode 100644 contrib/coco/core/src/IR/Input.cpp create mode 100644 contrib/coco/core/src/IR/Input.test.cpp diff --git a/contrib/coco/core/include/coco/IR/Input.h b/contrib/coco/core/include/coco/IR/Input.h new file mode 100644 index 0000000..27cc5a7 --- /dev/null +++ b/contrib/coco/core/include/coco/IR/Input.h @@ -0,0 +1,23 @@ +#ifndef __COCO_IR_INPUT_H__ +#define __COCO_IR_INPUT_H__ + +#include + +namespace coco +{ + +class Input +{ +public: + Input(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_INPUT_H__ diff --git a/contrib/coco/core/src/IR/Input.cpp b/contrib/coco/core/src/IR/Input.cpp new file mode 100644 index 0000000..f519290 --- /dev/null +++ b/contrib/coco/core/src/IR/Input.cpp @@ -0,0 +1,11 @@ +#include "coco/IR/Input.h" + +namespace coco +{ + +Input::Input(const nncc::core::ADT::tensor::Shape &shape) : _shape{shape} +{ + // DO NOTHING +} + +} // namespace coco diff --git a/contrib/coco/core/src/IR/Input.test.cpp b/contrib/coco/core/src/IR/Input.test.cpp new file mode 100644 index 0000000..7274f53 --- /dev/null +++ b/contrib/coco/core/src/IR/Input.test.cpp @@ -0,0 +1,11 @@ +#include "coco/IR/Input.h" + +#include + +TEST(IR_INPUT, ctor_should_set_shape) +{ + const nncc::core::ADT::tensor::Shape shape{1, 3, 3, 1}; + coco::Input input{shape}; + + ASSERT_EQ(input.shape(), shape); +} -- 2.7.4