Skip to content

Commit 285b371

Browse files
authored
Update Eigen to v5.0.1 (#3505)
1 parent 09255af commit 285b371

2 files changed

Lines changed: 12 additions & 14 deletions

File tree

cmake/eigen.cmake

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
function(download_eigen)
22
include(FetchContent)
33

4-
set(eigen_URL "https://gitlab.com/libeigen/eigen/-/archive/3.4.1/eigen-3.4.1.tar.gz")
5-
set(eigen_URL2 "https://hf-mirror.com/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/eigen-3.4.1.tar.gz")
6-
set(eigen_HASH "SHA256=b93c667d1b69265cdb4d9f30ec21f8facbbe8b307cf34c0b9942834c6d4fdbe2")
4+
set(eigen_URL "https://gitlab.com/libeigen/eigen/-/archive/5.0.1/eigen-5.0.1.tar.gz")
5+
set(eigen_HASH "SHA256=e9c326dc8c05cd1e044c71f30f1b2e34a6161a3b6ecf445d56b53ff1669e3dec")
76

87
# If you don't have access to the Internet,
98
# please pre-download eigen
109
set(possible_file_locations
11-
$ENV{HOME}/Downloads/eigen-3.4.1.tar.gz
12-
${CMAKE_SOURCE_DIR}/eigen-3.4.1.tar.gz
13-
${CMAKE_BINARY_DIR}/eigen-3.4.1.tar.gz
14-
/tmp/eigen-3.4.1.tar.gz
15-
/star-fj/fangjun/download/github/eigen-3.4.1.tar.gz
10+
$ENV{HOME}/Downloads/eigen-5.0.1.tar.gz
11+
${CMAKE_SOURCE_DIR}/eigen-5.0.1.tar.gz
12+
${CMAKE_BINARY_DIR}/eigen-5.0.1.tar.gz
13+
/tmp/eigen-5.0.1.tar.gz
14+
/star-fj/fangjun/download/github/eigen-5.0.1.tar.gz
1615
)
1716

1817
foreach(f IN LISTS possible_file_locations)
1918
if(EXISTS ${f})
2019
set(eigen_URL "${f}")
2120
file(TO_CMAKE_PATH "${eigen_URL}" eigen_URL)
2221
message(STATUS "Found local downloaded eigen: ${eigen_URL}")
23-
set(eigen_URL2)
2422
break()
2523
endif()
2624
endforeach()
@@ -29,7 +27,7 @@ function(download_eigen)
2927
set(EIGEN_BUILD_DOC OFF CACHE BOOL "" FORCE)
3028

3129
FetchContent_Declare(eigen
32-
URL ${eigen_URL} ${eigen_URL2}
30+
URL ${eigen_URL}
3331
URL_HASH ${eigen_HASH}
3432
)
3533

sherpa-onnx/csrc/offline-speaker-diarization-pyannote-impl.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ class OfflineSpeakerDiarizationPyannoteImpl
515515

516516
if (k != cur_row_index) {
517517
auto seq = Eigen::seqN(0, cur_row_index);
518-
ans = ans(seq, Eigen::all);
518+
ans = ans(seq, Eigen::placeholders::all);
519519
}
520520

521521
return ans;
@@ -596,7 +596,7 @@ class OfflineSpeakerDiarizationPyannoteImpl
596596

597597
auto seq = Eigen::seqN(start, labels[i].rows());
598598

599-
count(seq, Eigen::all).array() += labels[i].array();
599+
count(seq, Eigen::placeholders::all).array() += labels[i].array();
600600
}
601601

602602
bool has_last_chunk = ((num_samples - window_size) % window_shift) > 0;
@@ -606,7 +606,7 @@ class OfflineSpeakerDiarizationPyannoteImpl
606606
}
607607

608608
int32_t last_frame = num_samples / receptive_field_shift;
609-
return count(Eigen::seq(0, last_frame), Eigen::all);
609+
return count(Eigen::seq(0, last_frame), Eigen::placeholders::all);
610610
}
611611

612612
Matrix2DInt32 FinalizeLabels(const Matrix2DInt32 &count,
@@ -715,7 +715,7 @@ class OfflineSpeakerDiarizationPyannoteImpl
715715

716716
num_frames = (new_num_frames <= num_frames) ? new_num_frames : num_frames;
717717

718-
return ComputeResult(final_labels(Eigen::seq(0, num_frames), Eigen::all));
718+
return ComputeResult(final_labels(Eigen::seq(0, num_frames), Eigen::placeholders::all));
719719
}
720720

721721
void MergeSegments(

0 commit comments

Comments
 (0)