BendMlTensorFork.blocks1: def of bend-ml-tensor-fork@0.1.6.0 Import: import bend-ml-tensor-fork@0.1.6.0/main.bend as BendMlTensorFork Lines 43-51 of bend-ml-tensor-fork@0.1.6.0/main.bend: https://jend.leeeet.dev/read.txt?path=bend-ml-tensor-fork@0.1.6.0/main.bend&start_line=43&end_line=51 import Base def blocks1(~E: Data, ~A: Type, ~f: @+e: E -> @+i0: U32 -> @+cnt: Nat -> Array -> Array, +e: E, d: Nat, +i0: U32, +cnt: Nat, pa: Array & Array) -> Array: match d pa: case 0n Tuple{a, a2}: f(e, i0, cnt, a) case 1n++q Tuple{a, a2}: l r = blocks1(~E, ~A, ~f, e, q, i0, Nat.div(cnt, 2n), Array.fork(A, a)) blocks1(~E, ~A, ~f, e, q, (i0 + U32.from_nat(Nat.div(cnt, 2n)) : U32), Nat.sub(cnt, Nat.div(cnt, 2n)), Array.fork(A, a2)) Array.join(A, l, r) @unsafe Uses (11): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array.fork https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array.join https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.div https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.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.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.from_nat