diff --git a/paddle/fluid/pybind/inference_api.cc b/paddle/fluid/pybind/inference_api.cc index 7f3fe410464ede4c58396d6212c7ee4446047ebc..389beb4105497f982de98589fad5f442a2913df0 100644 --- a/paddle/fluid/pybind/inference_api.cc +++ b/paddle/fluid/pybind/inference_api.cc @@ -69,7 +69,8 @@ void BindMkldnnQuantizerConfig(py::module *m); #endif template -PaddleBuf PaddleBufCreate(py::array_t data) { +PaddleBuf PaddleBufCreate( + py::array_t data) { PaddleBuf buf(data.size() * sizeof(T)); std::copy_n(static_cast(data.data()), data.size(), static_cast(buf.data())); @@ -77,7 +78,9 @@ PaddleBuf PaddleBufCreate(py::array_t data) { } template -void PaddleBufReset(PaddleBuf &buf, py::array_t data) { // NOLINT +void PaddleBufReset( + PaddleBuf &buf, // NOLINT + py::array_t data) { // NOLINT buf.Resize(data.size() * sizeof(T)); std::copy_n(static_cast(data.data()), data.size(), static_cast(buf.data())); @@ -85,7 +88,8 @@ void PaddleBufReset(PaddleBuf &buf, py::array_t data) { // NOLINT template PaddleTensor PaddleTensorCreate( - py::array_t data, const std::string name = "", + py::array_t data, + const std::string name = "", const std::vector> &lod = {}, bool copy = true) { PaddleTensor tensor; @@ -137,8 +141,9 @@ py::array PaddleTensorGetData(PaddleTensor &tensor) { // NOLINT } template -void ZeroCopyTensorCreate(ZeroCopyTensor &tensor, // NOLINT - py::array_t data) { +void ZeroCopyTensorCreate( + ZeroCopyTensor &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)); @@ -146,8 +151,9 @@ void ZeroCopyTensorCreate(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));