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.
Tensor shape and dtype stay canonical while the open TensorStorage
contract supplies boxed host or loadable resident storage. Observation
through Tensor::cell, Tensor::cells, and Tensor::materialize is
checked so encoding and projection report resident readback failures.
Modules§
- domains
- Canonical symbols for the number-domain family.
Structs§
- Boxed
Tensor Storage - Boxed host storage for scalar runtime values.
- CpuTensor
Executor - Default host executor that delegates to the registered tensor functions.
- Spec
Tensor Descriptor - Metadata describing one registered
SpecTensorbackend, surfaced as a descriptor value so the registry can advertise the specialized tensor. - Submission
Evidence - Evidence returned after an executor has flushed accepted submissions.
- Tensor
- The uniform tensor value: an n-dimensional array of scalar number cells.
- Tensor
Executor Card - Description of one tensor executor.
- Tensor
Meta - Tensor shape and dtype expected from an execution request.
- Tensor
Numbers Lib - Registered number-domain library that installs the
numbers/tensordomain. - Tensor
Op - Open operation descriptor carried by a tensor request.
- Tensor
Request - A checked tensor execution request.
- Tensor
Site - Eval-fabric wrapper that binds one tensor executor for a realization.
- Typed
Tensor Storage - Host storage for typed scalar cells behind the canonical
Tensor.
Enums§
- Tensor
Exec Error - Error reported by tensor execution contracts.
- Tensor
Execution - Result of submitting a tensor request to an executor.
- Tensor
Location - The observable placement of tensor storage.
Constants§
- MAX_
TENSOR_ CELLS - The largest number of cells a tensor operation will materialize in one
allocation. A dimension product can be far below
usize::MAXand still be hopeless to allocate (a[1_000_000, 1_000_000]broadcast is1e12cells); this ceiling is the line past which the input is rejected rather than driven into an out-of-memory abort.
Statics§
- RECIPES
- Cookbook recipes for this domain, embedded at build time.
Traits§
- Spec
Tensor - Interface a specialized element-type tensor backend implements to bridge its
typed view and the uniform
Tensorvalue. - Tensor
Cell - A scalar cell type that can be held in typed host tensor storage.
- Tensor
Executor - A loadable provider that executes checked tensor requests.
- Tensor
Storage - Storage behind the canonical
Tensorvalue.
Functions§
- active_
tensor_ executor - Returns the tensor executor currently bound in the active environment.
- add_
op_ symbol - Open operation symbol for element-wise tensor addition.
- bounded_
element_ count - The number of cells in a tensor of the given shape, failing closed both when
the dimension product overflows
usize(viachecked_element_count) and when it exceedsMAX_TENSOR_CELLS. - 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. - cast_
op_ symbol - Open operation symbol for explicit tensor casts.
- cast_
symbol - Returns the qualified function symbol for explicit tensor dtype conversion.
- cast_
tensor - Casts a tensor into
target_dtype. - cast_
tensor_ value - Casts a tensor value into
target_dtypeand returns it as a runtime value. - 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). - cos_
op_ symbol - Open operation symbol for element-wise cosine.
- div_
op_ symbol - Open operation symbol for element-wise tensor division.
- dot_
op_ symbol - Open operation symbol for vector dot product.
- 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. - execute_
tensor_ binary_ op - Runs a binary tensor operation through the active executor, or CPU when no executor is bound in the environment.
- execute_
tensor_ dot - Runs a vector dot product through the active executor.
- execute_
tensor_ matmul - Runs vector or matrix multiplication through the active executor.
- execute_
tensor_ norm - Runs a Euclidean whole-tensor norm through the active executor.
- execute_
tensor_ reduction - Runs a whole-tensor sum, min, or max through the active executor.
- execute_
tensor_ request - Executes one tensor request through the active executor, defaulting to CPU.
- execute_
tensor_ transcendental - Runs an f32/f64/half element-wise transcendental through the active executor.
- execute_
tensor_ transpose - Runs a rank-2 transpose through the active executor.
- execute_
tensor_ unary_ op - Runs a unary tensor operation through the active executor, or CPU when no executor is bound in the environment.
- exp_
op_ symbol - Open operation symbol for element-wise exponential.
- flatten_
tensor_ scalar_ cells - Observes a tensor’s row-major scalar cells as a shared flat slice.
- index_
op_ symbol - Open operation symbol for indexing a tensor.
- map_
op_ symbol - Open operation symbol for mapping a callable over a tensor.
- mat_
op_ symbol - Open operation symbol for constructing a matrix tensor.
- matmul_
exec_ op_ symbol - Open operation symbol for matrix multiplication.
- max_
op_ symbol - Open operation symbol for reducing all tensor cells to the maximum value.
- min_
op_ symbol - Open operation symbol for reducing all tensor cells to the minimum value.
- mul_
op_ symbol - Open operation symbol for element-wise tensor multiplication.
- neg_
op_ symbol - Open operation symbol for element-wise tensor negation.
- norm_
op_ symbol - Open operation symbol for Euclidean norm over all tensor cells.
- 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_
bf16_ literal_ cell - Parses a tensor cell as a bfloat16 value, returning
Noneunless it is a number in thenumbers/bf16domain whose canonical f32-form text parses cleanly. - 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_
f16_ literal_ cell - Parses a tensor cell as an IEEE half-precision value, returning
Noneunless it is a number in thenumbers/f16domain whose canonical f32-form text parses cleanly. - parse_
f32_ literal_ cell - Parses a tensor cell as an
f32, returningNoneunless it is a number in thenumbers/f32domain whose canonical form 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. - pow_
op_ symbol - Open operation symbol for element-wise tensor exponentiation.
- rem_
op_ symbol - Open operation symbol for element-wise tensor remainder.
- reshape_
op_ symbol - Open operation symbol for reshaping a tensor.
- scalar_
op_ symbol - Open operation symbol for constructing a scalar tensor.
- sin_
op_ symbol - Open operation symbol for element-wise sine.
- slice_
op_ symbol - Open operation symbol for slicing a tensor.
- 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. - sqrt_
op_ symbol - Open operation symbol for element-wise square root.
- sub_
op_ symbol - Open operation symbol for element-wise tensor subtraction.
- sum_
op_ symbol - Open operation symbol for reducing all tensor cells with addition.
- tensor_
dtype - The shared element number domain (dtype) of a tensor’s cells.
- tensor_
execute_ capability - Capability required by TensorSite when a request asks for tensor execution authority.
- tensor_
executor_ math_ op_ symbols - Returns the operation symbols accepted by executor math providers.
- tensor_
executor_ symbol - Symbol bound in a TensorSite child environment to the active executor.
- tensor_
op_ symbol - Open operation symbol for constructing a tensor from shape, dtype, and cells.
- tensor_
site_ symbol - Symbol naming the local tensor execution site exported by the tensor lib.
- 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. - transpose_
exec_ op_ symbol - Open operation symbol for matrix transpose.
- vec_
op_ symbol - Open operation symbol for constructing a vector tensor.