---- 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
2312def cgLossForward : (family NvidiaLaunchSchedule) =
2313 (cgPhase
2314 cgPhaseOutput
2315 (cgThen
2316 (cgLaunch
2317 cgImageTargetGather
2318 (naturalDivideUnchecked cgSeq cgThreads)
2319 1
2320 1
2321 (cgPointer
2322 (cgArgument 0)
2323 cgCorrect
2324 (cgPointer (cgArgument 1) cgLogits (cgPointer (cgArgument 2) cgTargets cgNoSlots))))
2325 (cgThen
2326 (cgLaunch
2327 cgImageCrossEntropy
2328 cgSeq
2329 1
2330 1
2331 (cgPointer
2332 (cgArgument 0)
2333 cgLoss
2334 (cgPointer
2335 (cgArgument 1)
2336 cgLogits
2337 (cgPointer
2338 (cgArgument 2)
2339 cgCorrect
2340 (cgSlot
2341 (cgScalar 0)
2342 float32Log2E
2343 (cgSlot (cgScalar 1) float32Ln2 (cgSlot (cgScalar 2) cgInverseSeq cgNoSlots)))))))
2344 (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.