Bendtorch.PTree: type of bendtorch@1.3.0.0 Import: import bendtorch@1.3.0.0/main.bend as Bendtorch Lines 50-60 of bendtorch@1.3.0.0/main.bend: https://jend.leeeet.dev/read.txt?path=bendtorch@1.3.0.0/main.bend&start_line=50&end_line=60 import Base # AdamW's moments stored as packed BF16 (CAdamWBF16): a tree that follows the parameters' pairs as the step walks them, # with the buffers of each matrix at its leaf. A packed buffer has half the words of its matrix (two BF16 values a # U32, element 2k in the low half of word k, torch/dtype.bend's layout), so it cannot be a value of the parameters' # type P: the tree holds the words itself. A leaf is allocated on the matrix's first step (PNew marks a part not yet # stepped, and stays at the parameter-free layers), so the full-size buffers never exist. v16 picks v packed as well; # otherwise v is F32 (PLeafV). A leaf keeps its matrix's count n, for checkpoints. type PTree is Type: PNew{v16: Bool} PLeaf{n: U32, m: Array, v: Array} PLeafV{n: U32, m: Array, v: Array} PNode{a: PTree, b: PTree} Uses (4): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array 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=U32