[enco.caffe] Do NOT manipulate Kernel Layout via Kernel Object (#1696)
author박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Mon, 1 Oct 2018 10:27:30 +0000 (19:27 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Mon, 1 Oct 2018 10:27:30 +0000 (19:27 +0900)
This commit eliminates the use of kernel layout manipulation methods of
Kernel Object inside enco caffe frontend.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
contrib/enco/frontend/caffe/src/Frontend.cpp

index d128e6f..4fd2dca 100644 (file)
@@ -229,9 +229,12 @@ enco::Bundle Frontend::load(void) const
       const auto ker_shape = spec.ker_shape();
       auto ker_bag = m->entity()->bag()->create(num_elements(ker_shape));
       auto ker_obj = m->entity()->object()->create(morph::caffe::as_kernel_shape(ker_shape));
+      auto ker_layout = make_unique<coco::GenericKernelLayout>(ker_obj->shape());
+
+      ker_layout->reorder<kernel::NCHWLayout>();
 
       ker_obj->bag(ker_bag);
-      ker_obj->reorder<kernel::NCHWLayout>();
+      ker_obj->layout(std::move(ker_layout));
 
       // Create a kernel overlay for the kernel object
       auto ker_id = d->allocate(num_elements(ker_shape) * sizeof(float));