def fill_bf16

bend-ml-llama@0.2.1.0 · main.bend:1484

import bend-ml-llama@0.2.1.0/main.bend as BendMlLlama
import Base

1484# writes the BF16 numbers held in bs (2 bytes each), widened to F32, at index i, without building a list of F32
1485# first
1486def fill_bf16(bs: List<&2, U32>, +i: U32, a: Array<F32>) -> Array<F32>:
1487  match bs:
1488    case Con{+b0, Con{+b1, t}}:
1489      fill_bf16(t, (i + 1 : U32), Array.set(F32, a, i, bf16_le(b0, b1)))
1490    case _:
1491      a

Uses (7)

Used by (1)