diff --git a/src/framework/executor.cpp b/src/framework/executor.cpp index 4e4fc5c0cb59725b33f63fb085350b6a81e79156..8da8c1488bd689b431d36d3968ac752e299e9f14 100644 --- a/src/framework/executor.cpp +++ b/src/framework/executor.cpp @@ -922,12 +922,7 @@ void Executor::InitMemory() { if (var_desc->Persistable()) { CLImage *cl_image = nullptr; if (var_desc->Name() == "feed" || var_desc->Name() == "fetch") { - auto tensor = var->template GetMutable(); - if (var_desc->Name() == "fetch") { - const framework::TensorDesc &desc = var_desc->Tensor_desc(); - framework::DDim ddim = framework::make_ddim(desc.Dims()); - tensor->mutable_data(ddim); - } + var->template GetMutable(); continue; } else { cl_image = var->template GetMutable(); @@ -991,12 +986,7 @@ void Executor::InitCombineMemory() { if (var_desc->Persistable()) { CLImage *cl_image = nullptr; if (var_desc->Name() == "feed" || var_desc->Name() == "fetch") { - auto tensor = var->template GetMutable(); - if (var_desc->Name() == "fetch") { - const framework::TensorDesc &desc = var_desc->Tensor_desc(); - framework::DDim ddim = framework::make_ddim(desc.Dims()); - tensor->mutable_data(ddim); - } + var->template GetMutable(); continue; } else { cl_image = var->template GetMutable(); diff --git a/src/framework/operator.cpp b/src/framework/operator.cpp index ab9d4f788aa1eb8db8cc38b797c9f097ed260dac..9aeed326d1216278e491d20d1a1e052971fd3a77 100644 --- a/src/framework/operator.cpp +++ b/src/framework/operator.cpp @@ -95,7 +95,7 @@ void OperatorBase::Run() { if (type_ == "fetch") { Tensor *tensor = vari->template GetMutable(); if (tensor) { - DLOG << type_ << " output- " << key << "=" << tensor->dims(); + DLOG << type_ << " output- " << key << "=" << *tensor; } } else { CLImage *cl_image = vari->template GetMutable(); diff --git a/src/operators/kernel/cl/fetch_kernel.cpp b/src/operators/kernel/cl/fetch_kernel.cpp index a84f8d82f8bacff833d7a5aa7f3bb1a0683d1f89..807f8833440529fd6be4198112edc8a9a2223823 100644 --- a/src/operators/kernel/cl/fetch_kernel.cpp +++ b/src/operators/kernel/cl/fetch_kernel.cpp @@ -21,6 +21,8 @@ namespace operators { template <> bool FetchKernel::Init(FetchParam *param) { this->cl_helper_.AddKernel("fetch", "fetch_kernel.cl"); + auto *out = param->Out(); + out->mutable_data(); return true; }