diff --git a/paddle/fluid/pybind/inference_api.cc b/paddle/fluid/pybind/inference_api.cc index e503ca31cdd7440bb56618b677b4dc72d08e92ad..61b8b1643665c8088752111d06e2bb5ea1f16efb 100644 --- a/paddle/fluid/pybind/inference_api.cc +++ b/paddle/fluid/pybind/inference_api.cc @@ -119,9 +119,12 @@ py::dtype PaddleDTypeToNumpyDType(PaddleDType dtype) { case PaddleDType::FLOAT32: dt = py::dtype::of(); break; + case PaddleDType::UINT8: + dt = py::dtype::of(); + break; default: PADDLE_THROW(platform::errors::Unimplemented( - "Unsupported data type. Now only supports INT32, INT64 and " + "Unsupported data type. Now only supports INT32, INT64, UINT8 and " "FLOAT32.")); } @@ -187,9 +190,12 @@ py::array ZeroCopyTensorToNumpy(ZeroCopyTensor &tensor) { // NOLINT case PaddleDType::FLOAT32: tensor.copy_to_cpu(static_cast(array.mutable_data())); break; + case PaddleDType::UINT8: + tensor.copy_to_cpu(static_cast(array.mutable_data())); + break; default: PADDLE_THROW(platform::errors::Unimplemented( - "Unsupported data type. Now only supports INT32, INT64 and " + "Unsupported data type. Now only supports INT32, INT64, UINT8 and " "FLOAT32.")); } return array; diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index c7ee43a3bc07d29ebcda44e40d73055a853df006..34edb0280b0ba7244e5e904a4075cc30225d5895 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -112,4 +112,4 @@ if(LINUX AND NOT WITH_SW) message(FATAL_ERROR "patchelf not found, please install it.\n" "For Ubuntu, the command is: apt-get install -y patchelf.") endif() -endif(LINUX) +endif()