[enco.nnapi] Do NOT manipulate layout through KernelObject (#1699)
author박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Tue, 2 Oct 2018 00:01:36 +0000 (09:01 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Tue, 2 Oct 2018 00:01:36 +0000 (09:01 +0900)
This commit eliminates the use of deprecated Kernel layout manipulatoin
methods from NNAPI backend implementation.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
contrib/enco/core/src/Transforms/Normalize.cpp

index b4b16f2..c2d30dc 100644 (file)
@@ -153,11 +153,13 @@ void ShuffleGen::mutate(coco::UnitF *unit)
     // Reorder Kernel as NHWC
     auto ker_obj = unit->op()->asConv2D()->ker();
     auto ker_bag = ker_obj->bag();
+    auto ker_layout = make_unique<coco::GenericKernelLayout>(ker_obj->shape());
 
     assert(ker_bag != nullptr);
     assert(coco::dependent_objects(ker_bag).size() == 1);
     assert((ker_bag->isInput() == false) && (ker_bag->isOutput() == false));
-    ker_obj->reorder<nncc::core::ADT::kernel::NHWCLayout>();
+    ker_layout->reorder<nncc::core::ADT::kernel::NHWCLayout>();
+    ker_obj->layout(std::move(ker_layout));
   }
 }