From 30181a66c98373dde43d1cb6edd446d426d89c84 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: Wed, 5 Sep 2018 15:19:23 +0900 Subject: [PATCH] [coco] Introduce stride-related members in AvgPool2D (#1344) This commit introduces stride methods and related _stride field in AvgPool2D class. Signed-off-by: Jonghyun Park --- contrib/coco/core/include/coco/IR/AvgPool2D.h | 6 ++++++ contrib/coco/core/src/IR/AvgPool2D.test.cpp | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/contrib/coco/core/include/coco/IR/AvgPool2D.h b/contrib/coco/core/include/coco/IR/AvgPool2D.h index a5db9af..3cf6219 100644 --- a/contrib/coco/core/include/coco/IR/AvgPool2D.h +++ b/contrib/coco/core/include/coco/IR/AvgPool2D.h @@ -3,6 +3,7 @@ #include "coco/IR/Op.h" #include "coco/IR/Window2D.h" +#include "coco/IR/Stride2D.h" namespace coco { @@ -30,6 +31,10 @@ public: Window2D *window(void) { return &_window; } const Window2D *window(void) const { return &_window; } +public: + Stride2D *stride(void) { return &_stride; } + const Stride2D *stride(void) const { return &_stride; } + private: void get(const PtrLink **out) const override { *out = _op_link; } @@ -38,6 +43,7 @@ private: private: Window2D _window; + Stride2D _stride; }; } // namespace coco diff --git a/contrib/coco/core/src/IR/AvgPool2D.test.cpp b/contrib/coco/core/src/IR/AvgPool2D.test.cpp index efb127f..d65b734 100644 --- a/contrib/coco/core/src/IR/AvgPool2D.test.cpp +++ b/contrib/coco/core/src/IR/AvgPool2D.test.cpp @@ -51,6 +51,10 @@ TEST_F(AvgPool2DTest, initialization) // window() SHOULD return a valid pointer ASSERT_NE(mutable_ptr->window(), nullptr); ASSERT_EQ(mutable_ptr->window(), immutable_ptr->window()); + + // stride() SHOULD return a valid pointer + ASSERT_NE(mutable_ptr->stride(), nullptr); + ASSERT_EQ(mutable_ptr->stride(), immutable_ptr->stride()); } TEST_F(AvgPool2DTest, asAvgPool2D) -- 2.7.4