Expand description
The n-dimensional tensor number domain: the uniform Tensor value, its
domain registration and constructors (tensor, vec, mat, …), and the
SpecTensor interface that specialized element-type backends plug into.
Modules§
- domains
- Canonical symbols for the number-domain family.
Structs§
- Spec
Tensor Descriptor - Metadata describing one registered
SpecTensorbackend, surfaced as a descriptor value so the registry can advertise the specialized tensor. - Tensor
- The uniform tensor value: an n-dimensional array of scalar number cells.
- Tensor
Numbers Lib - Registered number-domain library that installs the
numbers/tensordomain.
Traits§
- Spec
Tensor - Interface a specialized element-type tensor backend implements to bridge its
own storage and the uniform
Tensorvalue.
Functions§
- build_
scalar_ tensor_ value - Builds a rank-0 scalar tensor wrapping a single scalar number
value. - build_
tensor_ value - Builds a tensor
Valueof the givenshapefrom row-majordatacells. - checked_
element_ count - The number of cells in a tensor of the given shape, failing closed when the
dimension product overflows
usizeinstead of wrapping (release) or panicking (debug). - element_
count - The number of cells in a tensor of the given shape. An empty shape is a
scalar (one cell). This is the one home for the
element_counthelper that the generic, broadcast, linalg, and every typed tensor crate re-grew. - flatten_
tensor_ scalar_ cells - Clones a tensor’s row-major cell values as a flat vector.
- number_
domain - The symbol naming the tensor number domain (
numbers/tensor). - number_
literal_ for_ tensor_ cell - Extracts the canonical
NumberLiteralof a scalar tensor cellvalue, orNoneif the value is not a number. Shared backing for the typed literal-cell parsers below. - parse_
complex_ literal_ cell - Parses a tensor cell as a
(real, imaginary)pair, returningNoneunless it is a number in thenumbers/complexdomain whose canonicala+biform parses cleanly. - parse_
f64_ literal_ cell - Parses a tensor cell as an
f64, returningNoneunless it is a number in thenumbers/f64domain whose canonical form parses cleanly. - parse_
i64_ literal_ cell - Parses a tensor cell as an
i64, returningNoneunless it is a number in thenumbers/i64domain whose canonical form parses cleanly. - parse_
rational_ literal_ cell - Parses a tensor cell as a
(numerator, denominator)rational pair, returningNoneunless it is a number in thenumbers/rationaldomain whose canonicalnum/denform parses cleanly. - spec_
tensor_ descriptor_ value - Encodes a
SpecTensorDescriptoras a registry descriptor table value withkind,symbol,dtype,implementation, andstorageentries. - spec_
tensor_ symbol - Builds a descriptor symbol (
numbers/tensor-spec/<name>) for a specialized tensor backend. - tensor_
dtype - The shared element number domain (dtype) of a tensor’s cells.
- tensor_
value_ class_ symbol - The symbol naming the tensor value class (
numbers/Tensor) under which tensor values register and reconstruct. - tensor_
value_ ref - Borrows the
Tensorbacking a value, orNoneif it is not a tensor.