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(
2727 const auto L = targets.size (1 );
2828 const auto S = 2 * L + 1 ;
2929
30- auto alphas_a = new scalar_t [S][2 ];
30+ auto alphas_a = new scalar_t [S][2 ]; // scalar_t is just logProbs.dtype()
3131 for (int i = 0 ; i < S; i++) {
3232 alphas_a[i][0 ] = kNegInfinity ;
3333 alphas_a[i][1 ] = kNegInfinity ;
@@ -122,6 +122,7 @@ void forced_align_impl(
122122 }
123123 auto idx1 = (T - 1 ) % 2 ;
124124 auto ltrIdx = alphas_a[S - 1 ][idx1] > alphas_a[S - 2 ][idx1] ? S - 1 : S - 2 ;
125+ delete[] alphas_a;
125126 // path stores the token index for each time step after force alignment.
126127 for (auto t = T - 1 ; t > -1 ; t--) {
127128 auto lbl_idx = ltrIdx % 2 == 0 ? blank : targets_a[batchIndex][ltrIdx / 2 ];
You can’t perform that action at this time.
0 commit comments