From aaaffd2e8505d5f2f1719c7a52c2cfa8c8bb1059 Mon Sep 17 00:00:00 2001 From: HongyuJia Date: Mon, 13 Feb 2023 11:08:28 +0800 Subject: [PATCH] [Fix Bug] Fix inference py::array_t calling bug (#50417) * fix py::array_t calling bug * polish code --- paddle/fluid/pybind/inference_api.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/paddle/fluid/pybind/inference_api.cc b/paddle/fluid/pybind/inference_api.cc index e5a3f46d42..8f74ef7e72 100644 --- a/paddle/fluid/pybind/inference_api.cc +++ b/paddle/fluid/pybind/inference_api.cc @@ -224,9 +224,8 @@ void ZeroCopyStringTensorCreate(ZeroCopyTensor &tensor, // NOLINT } template -void PaddleInferTensorCreate( - paddle_infer::Tensor &tensor, // NOLINT - py::array_t data) { +void PaddleInferTensorCreate(paddle_infer::Tensor &tensor, // NOLINT + py::array_t data) { std::vector shape; std::copy_n(data.shape(), data.ndim(), std::back_inserter(shape)); tensor.Reshape(std::move(shape)); -- GitLab