From 51249069c7d3199ecd8bbe1a58bf4e3c7ca72a48 Mon Sep 17 00:00:00 2001 From: xiebaiyuan Date: Wed, 26 Dec 2018 21:57:40 +0800 Subject: [PATCH] run android gpu for super --- src/framework/executor.cpp | 4 ++-- src/framework/executor.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/framework/executor.cpp b/src/framework/executor.cpp index e1131941ec..81b2ca985f 100644 --- a/src/framework/executor.cpp +++ b/src/framework/executor.cpp @@ -552,10 +552,9 @@ void Executor::SetInput(const Tensor &input, DLOG << "target_tensor->dims() " << target_tensor->dims(); DLOG << "input.dims() " << input.dims(); if (config_.load_when_predict) { - if (target_tensor->dims() != input.dims()) { + if (input_dim_last_ != input.dims()) { if (!target_tensor->IsInitialized()) { DLOG << "SetInput ---- > resize1"; - std::cout << "SetInput ---- > resize1" << std::endl; target_tensor->Resize(input.dims()); target_tensor->mutable_data(); } @@ -567,6 +566,7 @@ void Executor::SetInput(const Tensor &input, DLOG << "SetInput ---- > ShareDataWith"; } target_tensor->ShareDataWith(input); + input_dim_last_ = input.dims(); } template diff --git a/src/framework/executor.h b/src/framework/executor.h index 16fb2cab05..e77df5174c 100644 --- a/src/framework/executor.h +++ b/src/framework/executor.h @@ -84,7 +84,7 @@ class Executor { std::vector ops_list_; // for super resoltion - DDim input_dim_; + DDim input_dim_last_; #ifdef PADDLE_MOBILE_PROFILE struct ProfInfo { -- GitLab