From 57a0a8c717e9f541af0f00911c653d189766df88 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Fri, 3 May 2024 14:32:45 -0400 Subject: [PATCH 1/2] Fix codeql (#388) This pull request includes a change to the `nuget.config` file. The `nuget.org` package source has been removed and replaced with `ORT-Nightly` as the primary package source. --- nuget.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nuget.config b/nuget.config index 63a200340..f3853aee6 100644 --- a/nuget.config +++ b/nuget.config @@ -10,7 +10,7 @@ - + \ No newline at end of file From 31afa6137ad2f238e12964273134441025ff168d Mon Sep 17 00:00:00 2001 From: Ryan Hill <38674843+RyanUnderhill@users.noreply.github.com> Date: Fri, 3 May 2024 13:55:07 -0700 Subject: [PATCH 2/2] Add all numpy sized integer types to ToTensorType (#398) --- src/python/python.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/python/python.cpp b/src/python/python.cpp index 8bd25a9d3..ba685c10d 100644 --- a/src/python/python.cpp +++ b/src/python/python.cpp @@ -24,10 +24,22 @@ pybind11::array_t ToPython(std::span v) { ONNXTensorElementDataType ToTensorType(const pybind11::dtype& type) { switch (type.num()) { - case pybind11::detail::npy_api::NPY_INT32_: - return Ort::TypeToTensorType::type; + case pybind11::detail::npy_api::NPY_UINT8_: + return Ort::TypeToTensorType::type; + case pybind11::detail::npy_api::NPY_INT8_: + return Ort::TypeToTensorType::type; + case pybind11::detail::npy_api::NPY_UINT16_: + return Ort::TypeToTensorType::type; + case pybind11::detail::npy_api::NPY_INT16_: + return Ort::TypeToTensorType::type; case pybind11::detail::npy_api::NPY_UINT32_: return Ort::TypeToTensorType::type; + case pybind11::detail::npy_api::NPY_INT32_: + return Ort::TypeToTensorType::type; + case pybind11::detail::npy_api::NPY_UINT64_: + return Ort::TypeToTensorType::type; + case pybind11::detail::npy_api::NPY_INT64_: + return Ort::TypeToTensorType::type; case 23 /*NPY_FLOAT16*/: return Ort::TypeToTensorType::type; case pybind11::detail::npy_api::NPY_FLOAT_: