提交 51249069 编写于 作者: xiebaiyuan's avatar xiebaiyuan

run android gpu for super

上级 4769f4c9
...@@ -552,10 +552,9 @@ void Executor<GPU_CL, float>::SetInput(const Tensor &input, ...@@ -552,10 +552,9 @@ void Executor<GPU_CL, float>::SetInput(const Tensor &input,
DLOG << "target_tensor->dims() " << target_tensor->dims(); DLOG << "target_tensor->dims() " << target_tensor->dims();
DLOG << "input.dims() " << input.dims(); DLOG << "input.dims() " << input.dims();
if (config_.load_when_predict) { if (config_.load_when_predict) {
if (target_tensor->dims() != input.dims()) { if (input_dim_last_ != input.dims()) {
if (!target_tensor->IsInitialized()) { if (!target_tensor->IsInitialized()) {
DLOG << "SetInput ---- > resize1"; DLOG << "SetInput ---- > resize1";
std::cout << "SetInput ---- > resize1" << std::endl;
target_tensor->Resize(input.dims()); target_tensor->Resize(input.dims());
target_tensor->mutable_data<float>(); target_tensor->mutable_data<float>();
} }
...@@ -567,6 +566,7 @@ void Executor<GPU_CL, float>::SetInput(const Tensor &input, ...@@ -567,6 +566,7 @@ void Executor<GPU_CL, float>::SetInput(const Tensor &input,
DLOG << "SetInput ---- > ShareDataWith"; DLOG << "SetInput ---- > ShareDataWith";
} }
target_tensor->ShareDataWith(input); target_tensor->ShareDataWith(input);
input_dim_last_ = input.dims();
} }
template <typename Device, typename T> template <typename Device, typename T>
......
...@@ -84,7 +84,7 @@ class Executor { ...@@ -84,7 +84,7 @@ class Executor {
std::vector<OperatorBasePtr> ops_list_; std::vector<OperatorBasePtr> ops_list_;
// for super resoltion // for super resoltion
DDim input_dim_; DDim input_dim_last_;
#ifdef PADDLE_MOBILE_PROFILE #ifdef PADDLE_MOBILE_PROFILE
struct ProfInfo { struct ProfInfo {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册