Skip to content

Commit

Permalink
Fix switch
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanUnderhill committed May 1, 2024
1 parent 22fe6a3 commit 45415b6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/python/python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ pybind11::array_t<T> ToPython(std::span<T> v) {
ONNXTensorElementDataType ToTensorType(const pybind11::dtype& type) {
switch (type.num()) {
case pybind11::detail::npy_api::NPY_INT32_:
Ort::TypeToTensorType<int32_t>::type;
return Ort::TypeToTensorType<int32_t>::type;
case pybind11::detail::npy_api::NPY_UINT32_:
Ort::TypeToTensorType<uint32_t>::type;
return Ort::TypeToTensorType<uint32_t>::type;
case 23 /*NPY_FLOAT16*/:
return Ort::TypeToTensorType<Ort::Float16_t>::type;
case pybind11::detail::npy_api::NPY_FLOAT_:
Ort::TypeToTensorType<float>::type;
return Ort::TypeToTensorType<float>::type;
case pybind11::detail::npy_api::NPY_DOUBLE_:
Ort::TypeToTensorType<double>::type;
return Ort::TypeToTensorType<double>::type;
default:
throw std::runtime_error("Unsupported numpy type");
}
Expand Down

0 comments on commit 45415b6

Please sign in to comment.