[coco] Record stride configuration in MaxPool2D (#1320)
author박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Tue, 4 Sep 2018 07:01:51 +0000 (16:01 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Tue, 4 Sep 2018 07:01:51 +0000 (16:01 +0900)
This commit introduces a field and methods related with stride into
MaxPool2D class.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
contrib/coco/core/include/coco/IR/MaxPool2D.h
contrib/coco/core/src/IR/MaxPool2D.test.cpp

index 974c259..09a916f 100644 (file)
@@ -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<Op, Instr> **out) const override { *out = _op_link; }
 
@@ -38,6 +43,7 @@ private:
 
 private:
   Window2D _window;
+  Stride2D _stride;
 };
 
 } // namespace coco
index 187e3f8..2715ebc 100644 (file)
@@ -51,6 +51,10 @@ TEST_F(MaxPool2DTest, 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(MaxPool2DTest, asMaxPool2D)