BendTensors.Flat.mask_causal.step: def of bend-tensors@0.0.0.2 Import: import bend-tensors@0.0.0.2/bend_tensors.bend as BendTensors Lines 1876-1880 of bend-tensors@0.0.0.2/bend_tensors.bend: https://jend.leeeet.dev/read.txt?path=bend-tensors@0.0.0.2/bend_tensors.bend&start_line=1876&end_line=1880 import Base # cells above the diagonal (j > i) set to -3.4e38, the most negative # finite float, which a softmax turns into 0 with no inf - inf def Flat.mask_causal.step(+idx: U32, +i: U32, +j: U32, r: Array & F32) -> Array: (a, x) = r Array.set(F32, a, idx, Bool.pick(F32, U32.is_gt(j, i), (0.0 - 3.4028235e38 : F32), x)) Uses (9): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array.set https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_gt