BendtorchGpu.gr_2: def of bendtorch-gpu@1.3.0.0 Import: import bendtorch-gpu@1.3.0.0/main.bend as BendtorchGpu Lines 846-850 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=846&end_line=850 import Base import bendtorch@1.3.0.0/main.bend as T # backward 2: row r of P by the softmax, then G's row: s = dP·P over the i + 1 positions and G = (P * (dP - s)) * sc, # main.bend's gr3 and g_set2 def gr_2(+n: Nat, +off: U32, +sc: F32, g: Array, r: T.PC) -> T.A2: match r: case T.PC{p, c}: T.g_set2(n, sc, off, T.dot0(n, off, off, 1, 1, g, p)) Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=A2 https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=PC https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=dot0 https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=g_set2