[coco] Remove KernelObject create method with shape (#2125)
author박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Tue, 6 Nov 2018 00:46:27 +0000 (09:46 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Tue, 6 Nov 2018 00:46:27 +0000 (09:46 +0900)
This commit removes deprecated KernelObject "create" method with shape
from ObjectManager.

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

index 665d8d5..4949c83 100644 (file)
@@ -37,7 +37,6 @@ public:
 
 public:
   FeatureObject *create(const FeatureShape &shape);
-  KernelObject *create(const nncc::core::ADT::kernel::Shape &shape);
 
   template <typename T> T *create(void);
 
index 911a3c0..98d2154 100644 (file)
@@ -140,7 +140,7 @@ TEST(IR, caffe_conv)
 
     ker_layout->reorder<NCHWLayout>();
 
-    auto ker_obj = m->entity()->object()->create(ker_shape);
+    auto ker_obj = m->entity()->object()->create<coco::KernelObject>();
 
     ker_obj->bag(ker_bag);
     ker_obj->layout(std::move(ker_layout));
index 930bc99..0cb3af4 100644 (file)
@@ -101,7 +101,7 @@ struct IsConv2D : public coco::Op::DefaultVisitor<bool>
 TEST_F(Conv2DTest, ker_update)
 {
   // Prepare a kernel object for testing
-  auto obj = obj_mgr.create(nncc::core::ADT::kernel::Shape{1, 1, 3, 3});
+  auto obj = obj_mgr.create<coco::KernelObject>();
 
   // Test 'Conv2D' class
   auto op = allocate();
@@ -140,7 +140,7 @@ TEST_F(Conv2DTest, accept)
 TEST_F(Conv2DTest, destructor)
 {
   // Prepare a kernel object for testing
-  auto obj = obj_mgr.create(nncc::core::ADT::kernel::Shape{1, 1, 3, 3});
+  auto obj = obj_mgr.create<coco::KernelObject>();
 
   // Create 'Conv2D' op
   auto op = make_unique<coco::Conv2D>();
index c19c9df..15f8d0f 100644 (file)
@@ -177,7 +177,7 @@ TEST(IR_Module, create_entites)
 
   ASSERT_EQ(entity->bag()->create(1)->module(), m.get());
   ASSERT_EQ(entity->object()->create(feature::Shape{1, 2, 3})->module(), m.get());
-  ASSERT_EQ(entity->object()->create(kernel::Shape{1, 2, 3, 4})->module(), m.get());
+  ASSERT_EQ(entity->object()->create<coco::KernelObject>()->module(), m.get());
 #define OP(Name) ASSERT_EQ(entity->op()->create<Name>()->module(), m.get());
 #include "coco/IR/Op.lst"
 #undef OP
index eca1240..f923dad 100644 (file)
@@ -52,16 +52,6 @@ FeatureObject *ObjectManager::create(const nncc::core::ADT::feature::Shape &shap
   return take(std::move(feature));
 }
 
-KernelObject *ObjectManager::create(const nncc::core::ADT::kernel::Shape &shape)
-{
-  auto kernel = make_unique<KernelObject>(shape);
-  auto kernel_ptr = kernel.get();
-
-  modulize(kernel_ptr);
-
-  return take(std::move(kernel));
-}
-
 void ObjectManager::destroy(Object *o)
 {
   assert(o->def() == nullptr);
index 80ca7e3..78ecfd0 100644 (file)
@@ -35,22 +35,6 @@ TEST(IR_OBJECT_MANAGER, create_feature)
   ASSERT_EQ(o->shape(), shape);
 }
 
-TEST(IR_OBJECT_MANAGER, create_kernel)
-{
-  using nncc::core::ADT::kernel::Shape;
-
-  const Shape shape{1, 1, 3, 3};
-
-  coco::ObjectManager mgr;
-
-  auto o = mgr.create(shape);
-
-  ASSERT_EQ(o->shape().count(), shape.count());
-  ASSERT_EQ(o->shape().depth(), shape.depth());
-  ASSERT_EQ(o->shape().height(), shape.height());
-  ASSERT_EQ(o->shape().width(), shape.width());
-}
-
 TEST(IR_OBJECT_MANAGER, create_feature_with_template)
 {
   coco::ObjectManager mgr;