def t8_rpar

bend-ml-tensor-array@0.1.19.0 · main.bend:1070

import bend-ml-tensor-array@0.1.19.0/main.bend as BendMlTensorArray
import Base

1070# split by rows of C: the pieces are A's rows, B is shared; the result is C's rows in order
1071def t8_rpar(t: PT, +cnt: Nat, +m: Nat, +tk: Nat, +tku: U32, +rot: Nat, b: Array<T8>) -> List<&2, F32>:
1072  match t:
1073    case PLeaf{a}:
1074      t8_lfin(t8_lrows(cnt, m, tk, tku, rot, 0, TL{a, b, Nil{}}))
1075    case PNode{l, r}:
1076      t8_with2(List<&2, F32>, Array.clone(T8, b), b1 => b2 => (
1077        x y = t8_rpar(l, Nat.div(cnt, 2n), m, tk, tku, rot, b1) t8_rpar(r, Nat.sub(cnt, Nat.div(cnt, 2n)), m, tk, tku, rot, b2)
1078        List.append(&2, F32, x, y)))

Uses (15)

Used by (1)