Skip to main content

TensorAxis

Trait TensorAxis 

Source
pub trait TensorAxis: AxisExtension {
    const AXIS_ADDRESS: &'static str = "https://uor.foundation/axis/TensorAxis";
    const MAX_OUTPUT_BYTES: usize = 32;

    // Required method
    fn matmul(input: &[u8], out: &mut [u8]) -> Result<usize, ShapeViolation>;
}
Expand description

Wiki ADR-031 tensor-compute axis.

The reference impl CpuI8MatmulSquare<DIM> is parametric in DIM for square DIM × DIM i8 matrices, emitting a DIM × DIM i16 product (saturating) per ADR-030’s bit-determinism commitment.

Provided Associated Constants§

Source

const AXIS_ADDRESS: &'static str = "https://uor.foundation/axis/TensorAxis"

Source

const MAX_OUTPUT_BYTES: usize = 32

2 * MAX_TENSOR_DIM * MAX_TENSOR_DIM = 512 bytes for 16×16. Overridden per impl.

Required Methods§

Source

fn matmul(input: &[u8], out: &mut [u8]) -> Result<usize, ShapeViolation>

Multiply two row-major DIM × DIM i8 matrices into a DIM × DIM i16 product (saturating). Input is A || B (2 * DIM * DIM bytes); output is 2 * DIM * DIM bytes.

§Errors

Returns ShapeViolation on input/output byte-length mismatch.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<const DIM: usize> TensorAxis for CpuI8MatmulSquare<DIM>

Source§

const AXIS_ADDRESS: &'static str = "https://uor.foundation/axis/TensorAxis/CpuI8MatmulSquare"

Source§

const MAX_OUTPUT_BYTES: usize