def ph_new

bendtorch@1.3.0.0 · main.bend:404

import bendtorch@1.3.0.0/main.bend as Bendtorch
import Base

404# the leaf of a matrix on its first step: zeros (BF16 0x0000 is +0.0)
405def ph_new(+n: Nat, v16: Bool) -> PTree:
406  match v16:
407    case True{}:
408      PLeaf{U32.from_nat(n), ph_words(n), ph_words(n)}
409    case False{}:
410      PLeafV{U32.from_nat(n), ph_words(n), Array.new(F32, depth(n), 0.0)}

Uses (8)

Used by (2)