def MatT.from_rows.leaf

bend-tensors@0.0.0.2 · bend_tensors.bend:1103

import bend-tensors@0.0.0.2/bend_tensors.bend as BendTensors
import Base

1103# a leaf from up to four rows; missing rows and cells pad with 0.0
1104def MatT.from_rows.leaf(rows: List<&2, List<&2, F32>>) -> Blk:
1105  match rows:
1106    case r0 <> r1 <> r2 <> r3 <> rest:
1107      Blk.from_rows(r0, r1, r2, r3)
1108    case r0 <> r1 <> r2 <> []:
1109      Blk.from_rows(r0, r1, r2, [])
1110    case r0 <> r1 <> []:
1111      Blk.from_rows(r0, r1, [], [])
1112    case r0 <> []:
1113      Blk.from_rows(r0, [], [], [])
1114    case []:
1115      Blk.zeros()

Uses (5)

Used by (1)