diff --git a/CMakeLists.txt b/CMakeLists.txt index 93a7ae60..ae9fcd75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -100,7 +100,8 @@ FetchContent_MakeAvailable(dlpack) # ExternalProject_Add( boostorg - URL https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.tar.gz + # URL https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.tar.gz + URL https://archives.boost.io/release/1.79.0/source/boost_1_79_0.tar.gz URL_HASH SHA256=273f1be93238a068aba4f9735a4a2b003019af067b9c183ed227780b8f36062c PREFIX "boost-src" CONFIGURE_COMMAND ${CMAKE_COMMAND} -E copy_directory diff --git a/src/pb_tensor.cc b/src/pb_tensor.cc index 4011faad..84cd8f3f 100644 --- a/src/pb_tensor.cc +++ b/src/pb_tensor.cc @@ -433,12 +433,14 @@ PbTensor::FromDLPackCapsule( int64_t calculated_stride{1}; bool is_contiguous_c_order = true; for (size_t i = 1; i < dims.size(); i++) { - if (strides[ndim - i] != calculated_stride) { - is_contiguous_c_order = false; - break; - } + if (dims[ndim - i] != 1) { + if (strides[ndim - i] != calculated_stride) { + is_contiguous_c_order = false; + break; + } - calculated_stride *= dims[ndim - i]; + calculated_stride *= dims[ndim - i]; + } } if (!is_contiguous_c_order) {