File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
src/libtorchaudio/forced_align/cpu Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ void forced_align_impl(
27
27
const auto L = targets.size (1 );
28
28
const auto S = 2 * L + 1 ;
29
29
30
- auto alphas_a = new scalar_t [S][2 ];
30
+ auto alphas_a = new scalar_t [S][2 ]; // scalar_t is just logProbs.dtype()
31
31
for (int i = 0 ; i < S; i++) {
32
32
alphas_a[i][0 ] = kNegInfinity ;
33
33
alphas_a[i][1 ] = kNegInfinity ;
@@ -122,6 +122,7 @@ void forced_align_impl(
122
122
}
123
123
auto idx1 = (T - 1 ) % 2 ;
124
124
auto ltrIdx = alphas_a[S - 1 ][idx1] > alphas_a[S - 2 ][idx1] ? S - 1 : S - 2 ;
125
+ delete[] alphas_a;
125
126
// path stores the token index for each time step after force alignment.
126
127
for (auto t = T - 1 ; t > -1 ; t--) {
127
128
auto lbl_idx = ltrIdx % 2 == 0 ? blank : targets_a[batchIndex][ltrIdx / 2 ];
You can’t perform that action at this time.
0 commit comments