File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
src/libtorchaudio/forced_align/cpu Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ void forced_align_impl(
87
87
if (start == 0 ) {
88
88
alphas_a[0 ][curIdxOffset] =
89
89
alphas_a[0 ][prevIdxOffset] + logProbs_a[batchIndex][t][blank];
90
- backPtr_a[S * t] = 0 ;
90
+ backPtr_a[S * t] = 0 ; // backPtr_a[t][0] = 0
91
91
startloop += 1 ;
92
92
}
93
93
@@ -109,13 +109,13 @@ void forced_align_impl(
109
109
scalar_t result = 0.0 ;
110
110
if (x2 > x1 && x2 > x0) {
111
111
result = x2;
112
- backPtr_a[t * S + i] = 2 ;
112
+ backPtr_a[t * S + i] = 2 ; // backPtr_a[t][i] = 2
113
113
} else if (x1 > x0 && x1 > x2) {
114
114
result = x1;
115
- backPtr_a[t * S + i] = 1 ;
115
+ backPtr_a[t * S + i] = 1 ; // backPtr_a[t][i] = 1
116
116
} else {
117
117
result = x0;
118
- backPtr_a[t * S + i] = 0 ;
118
+ backPtr_a[t * S + i] = 0 ; // backPtr_a[t][i] = 0
119
119
}
120
120
alphas_a[i][curIdxOffset] = result + logProbs_a[batchIndex][t][labelIdx];
121
121
}
@@ -126,7 +126,7 @@ void forced_align_impl(
126
126
for (auto t = T - 1 ; t > -1 ; t--) {
127
127
auto lbl_idx = ltrIdx % 2 == 0 ? blank : targets_a[batchIndex][ltrIdx / 2 ];
128
128
paths_a[batchIndex][t] = lbl_idx;
129
- ltrIdx -= backPtr_a[t * S + ltrIdx];
129
+ ltrIdx -= backPtr_a[t * S + ltrIdx]; // backPtr_a[t][ltrIdx]
130
130
}
131
131
}
132
132
You can’t perform that action at this time.
0 commit comments