def t8_cpar

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

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

1084# split by columns of C: the pieces are B's columns, A is shared
1085def t8_cpar(t: PT, +cnt: Nat, +j0: U32, +n: Nat, +tk: Nat, +tku: U32, +rot: Nat, a: Array<T8>) -> List<&2, CB>:
1086  match t:
1087    case PLeaf{b}:
1088      [CB{j0, cnt, t8_lfin(t8_lrows(n, cnt, tk, tku, rot, 0, TL{a, b, Nil{}}))}]
1089    case PNode{l, r}:
1090      t8_with2(List<&2, CB>, Array.clone(T8, a), a1 => a2 => (
1091        x y = t8_cpar(l, Nat.div(cnt, 2n), j0, n, tk, tku, rot, a1) t8_cpar(r, Nat.sub(cnt, Nat.div(cnt, 2n)), (j0 + U32.from_nat(Nat.div(cnt, 2n)) : U32), n, tk, tku, rot, a2)
1092        List.append(&2, CB, x, y)))

Uses (17)

Used by (1)