Created by: Shixiaowei02
因业务需要,新增一组序列化 Paddle 输入数据的接口,统一 PaddleTensor 存盘的数据结构。 使用示例:
#include "paddle/include/paddle_inference_api.h"
namespace paddle {
namespace inference {
// 显式声明接口
extern void SerializePDTensorsToFile(const std::string& path,
const std::vector<PaddleTensor>& tensors);
} // namespace inference
} // namespace paddle
int main() {
std::vector<paddle::PaddleTensor> tensors;
paddle::inference::SerializePDTensorsToFile("./file", tensors);
return 0;
}