From 656d9abc67258da35b3d630393add560687481e0 Mon Sep 17 00:00:00 2001 From: TeslaZhao Date: Mon, 30 May 2022 21:55:43 +0800 Subject: [PATCH] Update general_response_op, support more types which is out of paddle::paddle_type --- core/general-server/op/general_response_op.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/general-server/op/general_response_op.cpp b/core/general-server/op/general_response_op.cpp index 07d3473e..0e4527c9 100644 --- a/core/general-server/op/general_response_op.cpp +++ b/core/general-server/op/general_response_op.cpp @@ -183,6 +183,13 @@ int GeneralResponseOp::inference() { VLOG(2) << "(logid=" << log_id << ")Prepare float16 var [" << model_config->_fetch_name[idx] << "]."; tensor->set_tensor_content(in->at(idx).data.data(), in->at(idx).data.length()); + } else { + // dType is not in paddle::PaddleDType, It's not return type of Paddle Inference. + // Copy all fields of Input data to output tensor. + VLOG(2) << "(logid=" << log_id << ")Prepare SPECIAL TYPE=" << dtype << " var [" + << model_config->_fetch_name[idx] << "]."; + tensor->set_elem_type(dtype); + tensor->set_tensor_content(in->at(idx).data.data(), in->at(idx).data.length()); } VLOG(2) << "(logid=" << log_id << ") fetch var [" -- GitLab