---- the loss ----
`correct` holds each row's target logit (the gather), so the rows hold
each row's cross-entropy; window 0 of the diagnostic block keeps them;
the backward reads loss + correct, the log-sum-exp
2311def cgLossForward : (family NvidiaLaunchSchedule) =
2312 (cgPhase
2313 cgPhaseOutput
2314 (cgThen
2315 (cgLaunch
2316 cgImageTargetGather
2317 (naturalDivideUnchecked cgSeq cgThreads)
2318 1
2319 1
2320 (cgPointer
2321 (cgArgument 0)
2322 cgCorrect
2323 (cgPointer (cgArgument 1) cgLogits (cgPointer (cgArgument 2) cgTargets cgNoSlots))))
2324 (cgThen
2325 (cgLaunch
2326 cgImageCrossEntropy
2327 cgSeq
2328 1
2329 1
2330 (cgPointer
2331 (cgArgument 0)
2332 cgLoss
2333 (cgPointer
2334 (cgArgument 1)
2335 cgLogits
2336 (cgPointer
2337 (cgArgument 2)
2338 cgCorrect
2339 (cgSlot
2340 (cgScalar 0)
2341 float32Log2E
2342 (cgSlot (cgScalar 1) float32Ln2 (cgSlot (cgScalar 2) cgInverseSeq cgNoSlots)))))))
2343 (cgCopy cgDiagnostic cgLoss cgWindowWords))))The compiler supplied declaration spans and resolved links from this source snapshot. This page does not assert that this file belongs to a checked closure.