Bendtorch.fpar: def of bendtorch@1.3.0.0 Import: import bendtorch@1.3.0.0/main.bend as Bendtorch Lines 2787-2795 of bendtorch@1.3.0.0/main.bend: https://jend.leeeet.dev/read.txt?path=bendtorch@1.3.0.0/main.bend&start_line=2787&end_line=2795 import Base import bend-ml-tensor-array@0.1.18.0/main.bend as TA # the n sequences of gs (cut in two halves) in a tree of parallel lets of depth d; the outputs come back in order def fpar(d: Nat, gs: Halves, +n: Nat, +h: Nat, +dm: Dm) -> List<&1, Array>: match d gs: case 0n Halves{l, r}: a b = fleaf(l, h, dm, Nil{}) fleaf(r, h, dm, Nil{}) List.append(&1, Array, a, b) case 1n++e Halves{l, r}: a b = fpar(e, cut(FS, TA.half(TA.half(n)), l, Nil{}), TA.half(n), h, dm) fpar(e, cut(FS, TA.half(Nat.sub(n, TA.half(n))), r, Nil{}), Nat.sub(n, TA.half(n)), h, dm) List.append(&1, Array, a, b) Uses (12): 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=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.sub https://jend.leeeet.dev/definition.txt?path=bend-ml-tensor-array@0.1.19.0/main.bend&name=half https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=Dm https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=FS https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=Halves https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=cut https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=fleaf