Tensor loaders #
These helpers convert simple in-memory Lean containers into typed tensors and datasets.
This is the canonical runtime layer for shape-checked construction from lists/arrays. The public
API re-exports these helpers from NN.API.Data; that is not a second implementation, just the
user-facing namespace. Keeping the implementation here is useful because the CSV/NPY loaders and
training examples can share the same Result error model and the same Dataset type without
depending on the higher-level API facade.
Tensor construction from lists #
Build a length-n vector from a list, with a length check.
This is the safe list boundary for dependent tensor shapes: callers bring ordinary runtime data,
and the loader either proves the length matches n internally or returns a tagged error.
Instances For
Build a length-n vector from an Array, using the same checks as vectorOfList.
Instances For
Build an m×n matrix from a list of m rows, each of length n.
Both dimensions are checked before constructing the dependent tensor. If a row has the wrong length, the error reports the first bad row so data issues are easier to diagnose.
Instances For
Build an m×n matrix from an Array (Array a), using the same checks as matrixOfLists.
Instances For
Dataset helpers #
Convert list-rows into a dataset of length-n vectors.