diff --git a/src/framework/tensor.h b/src/framework/tensor.h index 721d4ea5e93cf305880ea124a58769f4fa99db62..403768f858d3ff93c592768822a21b32234e16d8 100644 --- a/src/framework/tensor.h +++ b/src/framework/tensor.h @@ -116,8 +116,8 @@ class Tensor { PADDLE_MOBILE_ENFORCE( (std::is_same::value || holder_->type().hash_code() == typeid(T).hash_code()), - "Tensor holds the wrong type, it holds %s", - this->holder_->type().name()); + "Tensor holds the wrong type, it holds %s ,requested:%s", + this->holder_->type().name(), typeid(T).name()); return reinterpret_cast( reinterpret_cast(holder_->ptr()) + offset_); diff --git a/src/operators/feed_op.h b/src/operators/feed_op.h index 9b632034113bf5b627ba069a108f067b71a008b7..5969e679552345d25c8c9c7a4950eb3b6d72eca2 100644 --- a/src/operators/feed_op.h +++ b/src/operators/feed_op.h @@ -36,9 +36,14 @@ class FeedOp : public framework::OperatorBase { out_dims[0] = param_.BatchSize(); param_.Out()->Resize(out_dims); } - void Init() {} #ifdef PADDLE_MOBILE_FPGA + + void Init() { + Tensor *output = param_.Out(); + output->mutable_data(); + } + void RunImpl() const { const Tensor *input = param_.InputX(); auto input_ptr = input->data(); @@ -56,6 +61,7 @@ class FeedOp : public framework::OperatorBase { } #else + void Init() {} void RunImpl() const { param_.Out()->ShareDataWith(*param_.InputX()); } #endif