Apply copying for permuteInit of ConstantInitializer (#9147)
author장지섭/On-Device Lab(SR)/Engineer/삼성전자 <jiseob.jang@samsung.com>
Mon, 25 Nov 2019 01:51:26 +0000 (10:51 +0900)
committer오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Mon, 25 Nov 2019 01:51:26 +0000 (10:51 +0900)
This commit applies copying for permuteInit of ConstantInitializer.

Signed-off-by: jiseob.jang <jiseob.jang@samsung.com>
runtime/neurun/core/include/backend/IConstantInitializer.h

index feab84c..15d0934 100644 (file)
@@ -143,7 +143,8 @@ template <typename T>
 void permuteInit(const neurun::model::Operand &model_obj, neurun::backend::operand::IObject &obj,
                  const neurun::model::Layout frontend_layout)
 {
-  Init<T>(model_obj, obj, false, frontend_layout);
+  const bool copy = frontend_layout == obj.ptr()->layout();
+  Init<T>(model_obj, obj, copy, frontend_layout);
 }
 
 } // namespace