Skip to main content

Module tensor

Module tensor 

Source
Expand description

Owned, fixed-capacity inline tensor (no_std, no_alloc).

Tensor<T, N, R> stores up to N elements of scalar type T with a compile-time rank R. Data is held inline (stack / static storage), so no heap allocation is required. A live-element count (len) tracks how many of the N slots are in use; the shape array [usize; R] records the logical dimensions.

Use &Tensor<T, N, R> for a borrowed, zero-copy view into an existing buffer (e.g. a frame from a DMA ring).

Structs§

Tensor
Owned, fixed-capacity tensor stored inline.

Constants§

TEST_TENSOR_BYTE_COUNT
Total live payload byte count of TestTensor.
TEST_TENSOR_ELEMENT_COUNT
Total live element count of TestTensor.
TEST_TENSOR_SHAPE
Canonical shape used by shared test and benchmark tensor fixtures.

Functions§

create_test_tensor_filled_with
Create a shared test tensor with every element set to the same value.
create_test_tensor_from_array
Create a shared test tensor from explicit 3 × 3 element values.

Type Aliases§

TestTensor
Shared rank-2 tensor payload used by tests and benchmarks.