Bendtorch.ph_new: def of bendtorch@1.3.0.0 Import: import bendtorch@1.3.0.0/main.bend as Bendtorch Lines 404-410 of bendtorch@1.3.0.0/main.bend: https://jend.leeeet.dev/read.txt?path=bendtorch@1.3.0.0/main.bend&start_line=404&end_line=410 import Base # the leaf of a matrix on its first step: zeros (BF16 0x0000 is +0.0) def ph_new(+n: Nat, v16: Bool) -> PTree: match v16: case True{}: PLeaf{U32.from_nat(n), ph_words(n), ph_words(n)} case False{}: PLeafV{U32.from_nat(n), ph_words(n), Array.new(F32, depth(n), 0.0)} Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array.new https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.from_nat https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=PTree https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=depth https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=ph_words