Commit 0b531ca
committed
fix: resolve nullable type inference compilation error in trainbatch
Replace null-conditional operator trueLabels?[i] with explicit null check
to avoid 'TOutput cannot be made nullable' compiler error.
Changes:
- Use explicit null check with hasLabel flag instead of trueLabels?[i]
- Pass default(TOutput) when hasLabel is false
- Preserves original intent without requiring nullable constraints on TOutput
This fixes the compilation blocker at line 153.
Resolves coderabbitai review comment on line 172 (formerly 112).1 parent 87c8373 commit 0b531ca
File tree
1 file changed
+9
-3
lines changed- src/KnowledgeDistillation
1 file changed
+9
-3
lines changedLines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
154 | 160 | | |
155 | 161 | | |
156 | 162 | | |
| |||
159 | 165 | | |
160 | 166 | | |
161 | 167 | | |
162 | | - | |
163 | | - | |
| 168 | + | |
| 169 | + | |
164 | 170 | | |
165 | 171 | | |
166 | 172 | | |
| |||
0 commit comments