S-exp GPU
All pages
Docs · Function transformsMarkdown

Read a model's buffers

(buffers roots) returns a path-keyed plist of the model's defbuffer values. A model or a static list/vector/plist of model roots is accepted. Paths are ordered lexically, and a tied value appears once. Shapes, kinds and shared values are preserved. No buffer update runs when the tree is read.

Save the buffered model as buffered.sx, then inspect its offset:

sexpgpu probe buffered.sx --expr '(getf (buffers model) :model.offset)' --max-elements 100

The result is 2.0. Use tree-merge to combine these values with parameters and frozen-parameters for a complete functional-call binding tree. A model with no buffers returns nil.

Query inside a function or lambda after model paths are assigned. An early query during top-level loading is E-FUNC-003. The tree holds ordinary tensor values when read in a traced function; replacing a leaf changes a functional call's input, and does not write the model's stored buffer.