Skip to content

Commit aaaffd2

Browse files
authored
[Fix Bug] Fix inference py::array_t calling bug (#50417)
* fix py::array_t calling bug * polish code
1 parent 15d9339 commit aaaffd2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

paddle/fluid/pybind/inference_api.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,8 @@ void ZeroCopyStringTensorCreate(ZeroCopyTensor &tensor, // NOLINT
224224
}
225225

226226
template <typename T>
227-
void PaddleInferTensorCreate(
228-
paddle_infer::Tensor &tensor, // NOLINT
229-
py::array_t<T, py::array::c_style | py::array::forcecast> data) {
227+
void PaddleInferTensorCreate(paddle_infer::Tensor &tensor, // NOLINT
228+
py::array_t<T, py::array::c_style> data) {
230229
std::vector<int> shape;
231230
std::copy_n(data.shape(), data.ndim(), std::back_inserter(shape));
232231
tensor.Reshape(std::move(shape));

0 commit comments

Comments
 (0)