Skip to main content

Crate tensor4all_tensorbackend

Crate tensor4all_tensorbackend 

Source
Expand description

Tensor storage and linear algebra backend for tensor4all.

This crate provides:

  • Storage: Dynamic snapshot storage for logical tensor values
  • StructuredStorage: axis_classes-aware materialized snapshots
  • AnyScalar: Dynamic scalar type backed by rank-0 tenferro::Tensor
  • tenferro-backed execution helpers for tensor algebra

§Feature Flags

  • backend-tenferro (default): Use tenferro backend for linalg/einsum

Structs§

AllocatorPressureRelief
Result reported by release_process_allocator_cached_memory.
FullPivLuMatrixResult
Result of complete-pivoting LU decomposition on Matrix values.
FullPivLuResult
Result of complete-pivoting LU decomposition P A Q^T = L U.
Matrix
A dense 2D matrix in column-major layout.
Storage
Storage backend for tensor data.
StructuredStorage
Structured tensor snapshot storage.
SvdResult
Result of SVD decomposition A = U * diag(S) * Vt.

Enums§

NativeTensorReadInput
Read-only native tensor input that can either borrow external payload data or own a temporary materialized tensor.
StorageError
Errors returned by storage payload and elementwise operations.
StorageKind
Classifies the compact layout used by Storage.

Traits§

BackendLinalgScalar
Scalar bound accepted by tensor4all’s typed linalg wrappers.
BlasMul
BLAS-backed matrix multiplication dispatch.
MatrixScalar
Scalar bound for dense backend matrix utilities.
MatrixSolveScalar
Scalar types supported by solve_matrix.
StorageScalar
Trait for scalar types that can be stored in Storage.
SumFromStorage
Types that can be computed as the result of a reduction over Storage.
TensorElement
Public scalar element types supported by tensor4all dense/diag constructors.

Functions§

axpby_native_tensor
Compute a * lhs + b * rhs.
axpby_storage_native
Compute a * lhs + b * rhs over storages via native tensors.
conj_native_tensor
Conjugate a native tensor.
contract_native_tensor
Contract two native tensors along matching axes.
contract_storage
Contract two storage tensors along specified axes.
contract_storage_native
Contract storages via native tensors.
default_eager_ctx
Return the process-global eager context used for reverse-mode AD.
dense_native_tensor_from_col_major
Build a dense native tensor from column-major data.
diag_native_tensor_from_col_major
Build a dense native tensor whose logical values are diagonal.
einsum_native_tensor_reads
Execute a cached einsum over read-only native tensor inputs.
einsum_native_tensors
Execute a cached einsum over borrowed native tensors.
einsum_native_tensors_owned
Execute a cached einsum over owned native tensors.
from_vec2d
Create a matrix from a 2D vector.
full_piv_lu_backend
Compute complete-pivoting LU with the configured tenferro backend.
full_piv_lu_matrix
Compute complete-pivoting LU for a column-major Matrix.
make_mut_storage
Helper to get a mutable reference to storage, cloning if needed (COW).
mat_mul
Matrix multiplication: A * B.
mindim
Get the minimum dimension from a slice of dimensions.
native_tensor_primal_to_dense_c64_col_major
Materialize dense Complex64 values from a native tensor.
native_tensor_primal_to_dense_col_major
Materialize dense column-major values from a native tensor.
native_tensor_primal_to_dense_f64_col_major
Materialize dense f64 values from a native tensor.
native_tensor_primal_to_diag_c64
Extract the diagonal payload from a complex native tensor.
native_tensor_primal_to_diag_f64
Extract the diagonal payload from a real native tensor.
native_tensor_primal_to_storage
Materialize a native tensor into dense storage.
outer_product_native_tensor
Compute the outer product of two native tensors.
outer_product_storage_native
Outer-product storages via native tensors.
permute_native_tensor
Permute axes of a native tensor.
permute_storage_native
Permute storage by round-tripping through native tensors.
print_and_reset_native_einsum_profile
Print and clear the aggregated native einsum profile.
qr_backend
Compute a thin/economy QR decomposition on a typed tensor.
qr_native_tensor
Compute a QR decomposition on a native tensor.
release_process_allocator_cached_memory
Ask the process allocator to return cached/free memory to the operating system.
reset_native_einsum_profile
Reset the aggregated native einsum profile.
reshape_col_major_native_tensor
Reshape a native tensor without changing its column-major linearization.
scale_native_tensor
Multiply a native tensor by a dynamic scalar.
scale_storage_native
Scale storage by a scalar via native tensors.
solve_backend
Solve A X = B with the configured tenferro backend.
solve_matrix
Solve A X = B for column-major Matrix values.
storage_payload_native_read_input
Build a read-only native tensor input over the compact storage payload.
storage_to_native_tensor
Convert storage to a dense native tensor.
submatrix
Get a submatrix by selecting specific rows and columns.
submatrix_argmax
Find the position and value of the maximum absolute value in a submatrix.
sum_native_tensor
Sum all elements of a native tensor, returning a dynamic scalar.
svd_backend
Compute a thin/economy SVD on a typed tensor.
svd_native_tensor
Compute an SVD on a native tensor.
swap_cols
Swap two columns in a matrix in-place.
swap_rows
Swap two rows in a matrix in-place.
tangent_native_tensor
Return the tangent tensor when present.
transpose
Transpose the matrix.
with_default_backend
Run a closure against the process-global CPU backend.

Type Aliases§

AnyScalar
Backward-compatible scalar type name used across tensor4all APIs.
StorageResult
Result type returned by storage methods that can fail with StorageError.