未验证 提交 aaaffd2e 编写于 作者: H HongyuJia 提交者: GitHub

[Fix Bug] Fix inference py::array_t calling bug (#50417)

* fix py::array_t calling bug

* polish code
上级 15d93394
......@@ -224,9 +224,8 @@ void ZeroCopyStringTensorCreate(ZeroCopyTensor &tensor, // NOLINT
}
template <typename T>
void PaddleInferTensorCreate(
paddle_infer::Tensor &tensor, // NOLINT
py::array_t<T, py::array::c_style | py::array::forcecast> data) {
void PaddleInferTensorCreate(paddle_infer::Tensor &tensor, // NOLINT
py::array_t<T, py::array::c_style> data) {
std::vector<int> shape;
std::copy_n(data.shape(), data.ndim(), std::back_inserter(shape));
tensor.Reshape(std::move(shape));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册