Skip to content

Commit

Permalink
avoid seek overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
MahmoudAshraf97 authored May 19, 2024
1 parent 0129429 commit 7bb780e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/libtorchaudio/forced_align/cpu/compute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ void forced_align_impl(
// S * (T-L), we will use a safety margin of (T-L) to avoid reallocation
std::vector<bool> backPtrBit0((S + 1) * (T - L), false);
std::vector<bool> backPtrBit1((S + 1) * (T - L), false);
unsigned int backPtr_offset[T - 1];
unsigned int backPtr_seek[T - 1];
unsigned long long backPtr_offset[T - 1];
unsigned long long backPtr_seek[T - 1];
auto logProbs_a = logProbs.accessor<scalar_t, 3>();
auto targets_a = targets.accessor<target_t, 2>();
auto paths_a = paths.accessor<target_t, 2>();
Expand All @@ -60,7 +60,7 @@ void forced_align_impl(
auto labelIdx = (i % 2 == 0) ? blank : targets_a[batchIndex][i / 2];
alphas_a[0][i] = logProbs_a[batchIndex][0][labelIdx];
}
unsigned int seek = 0;
unsigned long long seek = 0;
for (auto t = 1; t < T; t++) {
if (T - t <= L + R) {
if ((start % 2 == 1) &&
Expand Down

0 comments on commit 7bb780e

Please sign in to comment.