提交 d18242d1 编写于 作者: Z zhangyang0701 提交者: GitHub

Merge pull request #788 from chonwhite/develop

fix:#787
......@@ -116,8 +116,8 @@ class Tensor {
PADDLE_MOBILE_ENFORCE(
(std::is_same<T, void>::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<const T *>(
reinterpret_cast<uintptr_t>(holder_->ptr()) + offset_);
......
......@@ -36,9 +36,14 @@ class FeedOp : public framework::OperatorBase<DeviceType> {
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<half>();
}
void RunImpl() const {
const Tensor *input = param_.InputX();
auto input_ptr = input->data<float>();
......@@ -56,6 +61,7 @@ class FeedOp : public framework::OperatorBase<DeviceType> {
}
#else
void Init() {}
void RunImpl() const { param_.Out()->ShareDataWith(*param_.InputX()); }
#endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册