BendtorchGpu.CrossEntropy: def of bendtorch-gpu@1.3.0.0 Import: import bendtorch-gpu@1.3.0.0/main.bend as BendtorchGpu Lines 1610-1613 of bendtorch-gpu@1.3.0.0/main.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-gpu@1.3.0.0/main.bend&start_line=1610&end_line=1613 import Base import bend-ml-tensor-array@0.1.18.0/main.bend as TA import bendtorch@1.3.0.0/main.bend as T # cross-entropy over n rows of c classes against the labels (main.bend's CrossEntropy; its bits but CUDA's exp) def CrossEntropy(+n: Nat, +c: Nat, z: TA.Mat, +labels: List<&2, Nat>) -> T.LossOut>: match z: case TA.Mat{d}: cx_1(n, c, labels, d, ids_arr(n, labels)) Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=bend-ml-tensor-array@0.1.19.0/main.bend&name=Mat https://jend.leeeet.dev/definition.txt?path=bendtorch-gpu@1.3.0.0/main.bend&name=cx_1 https://jend.leeeet.dev/definition.txt?path=bendtorch-gpu@1.3.0.0/main.bend&name=ids_arr https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=LossOut