| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 74afa14 commit 725ec1e
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -180,10 +180,11 @@ public DatasetPass load_data( | |||
| 180 | 180 | // 0 (padding), 1 (start), 2 (OOV) | |
| 181 | 181 | if (oov_char != null) | |
| 182 | 182 | { | |
| 183 | - int[,] new_xs_array = new int[xs_array.GetLength(0), xs_array.GetLength(1)]; | ||
| 184 | - for (var i = 0; i < xs_array.GetLength(0); i++) | ||
| 183 | + var (d1, d2) = (xs_array.GetLength(0), xs_array.GetLength(1)); | ||
| 184 | + int[,] new_xs_array = new int[d1, d2]; | ||
| 185 | + for (var i = 0; i < d1; i++) | ||
| 185 | 186 | { | |
| 186 | - for (var j = 0; j < xs_array.GetLength(1); j++) | ||
| 187 | + for (var j = 0; j < d2; j++) | ||
| 187 | 188 | { | |
| 188 | 189 | if (xs_array[i, j] == 0 || skip_top <= xs_array[i, j] && xs_array[i, j] < num_words) | |
| 189 | 190 | new_xs_array[i, j] = xs_array[i, j]; | |
@@ -195,11 +196,12 @@ public DatasetPass load_data( | |||
| 195 | 196 | } | |
| 196 | 197 | else | |
| 197 | 198 | { | |
| 198 | - int[,] new_xs_array = new int[xs_array.GetLength(0), xs_array.GetLength(1)]; | ||
| 199 | - for (var i = 0; i < xs_array.GetLength(0); i++) | ||
| 199 | + var (d1, d2) = (xs_array.GetLength(0), xs_array.GetLength(1)); | ||
| 200 | + int[,] new_xs_array = new int[d1, d2]; | ||
| 201 | + for (var i = 0; i < d1; i++) | ||
| 200 | 202 | { | |
| 201 | 203 | int k = 0; | |
| 202 | - for (var j = 0; j < xs_array.GetLength(1); j++) | ||
| 204 | + for (var j = 0; j < d2; j++) | ||
| 203 | 205 | { | |
| 204 | 206 | if (xs_array[i, j] == 0 || skip_top <= xs_array[i, j] && xs_array[i, j] < num_words) | |
| 205 | 207 | new_xs_array[i, k++] = xs_array[i, j]; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments