Skip to main content

Crate sim_lib_numbers_tensor

Crate sim_lib_numbers_tensor 

Source
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§

BoxedTensorStorage
Boxed host storage for scalar runtime values.
CpuTensorExecutor
Default host executor that delegates to the registered tensor functions.
SpecTensorDescriptor
Metadata describing one registered SpecTensor backend, surfaced as a descriptor value so the registry can advertise the specialized tensor.
SubmissionEvidence
Evidence returned after an executor has flushed accepted submissions.
Tensor
The uniform tensor value: an n-dimensional array of scalar number cells.
TensorExecutorCard
Description of one tensor executor.
TensorMeta
Tensor shape and dtype expected from an execution request.
TensorNumbersLib
Registered number-domain library that installs the numbers/tensor domain.
TensorOp
Open operation descriptor carried by a tensor request.
TensorRequest
A checked tensor execution request.
TensorSite
Eval-fabric wrapper that binds one tensor executor for a realization.
TypedTensorStorage
Host storage for typed scalar cells behind the canonical Tensor.

Enums§

TensorExecError
Error reported by tensor execution contracts.
TensorExecution
Result of submitting a tensor request to an executor.
TensorLocation
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::MAX and still be hopeless to allocate (a [1_000_000, 1_000_000] broadcast is 1e12 cells); 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§

SpecTensor
Interface a specialized element-type tensor backend implements to bridge its typed view and the uniform Tensor value.
TensorCell
A scalar cell type that can be held in typed host tensor storage.
TensorExecutor
A loadable provider that executes checked tensor requests.
TensorStorage
Storage behind the canonical Tensor value.

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 (via checked_element_count) and when it exceeds MAX_TENSOR_CELLS.
build_scalar_tensor_value
Builds a rank-0 scalar tensor wrapping a single scalar number value.
build_tensor_value
Builds a tensor Value of the given shape from row-major data cells.
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_dtype and 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 usize instead 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_count helper 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
Compatibility view of 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 NumberLiteral of a scalar tensor cell value, or None if 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 None unless it is a number in the numbers/bf16 domain whose canonical f32-form text parses cleanly.
parse_complex_literal_cell
Parses a tensor cell as a (real, imaginary) pair, returning None unless it is a number in the numbers/complex domain whose canonical a+bi form parses cleanly.
parse_f16_literal_cell
Parses a tensor cell as an IEEE half-precision value, returning None unless it is a number in the numbers/f16 domain whose canonical f32-form text parses cleanly.
parse_f32_literal_cell
Parses a tensor cell as an f32, returning None unless it is a number in the numbers/f32 domain whose canonical form parses cleanly.
parse_f64_literal_cell
Parses a tensor cell as an f64, returning None unless it is a number in the numbers/f64 domain whose canonical form parses cleanly.
parse_i64_literal_cell
Parses a tensor cell as an i64, returning None unless it is a number in the numbers/i64 domain whose canonical form parses cleanly.
parse_rational_literal_cell
Parses a tensor cell as a (numerator, denominator) rational pair, returning None unless it is a number in the numbers/rational domain whose canonical num/den form 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 SpecTensorDescriptor as a registry descriptor table value with kind, symbol, dtype, implementation, and storage entries.
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 Tensor backing a value, or None if 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.