Skip to main content

Tensor

Trait Tensor 

Source
pub trait Tensor: Sealed {
    // Required methods
    fn as_flat(&self) -> &[i8];
    fn as_flat_mut(&mut self) -> &mut [i8];
}
Expand description

An int8 tensor for the elementwise layers (QAdd, QMul): [i8; N], [[i8; C]; W] or [[[i8; C]; W]; H], read as its elements in memory order. Sealed: the crate implements it.

Required Methods§

Source

fn as_flat(&self) -> &[i8]

The elements in memory order.

Source

fn as_flat_mut(&mut self) -> &mut [i8]

The elements in memory order, mutable.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<const H: usize, const W: usize, const C: usize> Tensor for [[[i8; C]; W]; H]

Source§

fn as_flat(&self) -> &[i8]

Source§

fn as_flat_mut(&mut self) -> &mut [i8]

Source§

impl<const N: usize> Tensor for [i8; N]

Source§

fn as_flat(&self) -> &[i8]

Source§

fn as_flat_mut(&mut self) -> &mut [i8]

Source§

impl<const W: usize, const C: usize> Tensor for [[i8; C]; W]

Source§

fn as_flat(&self) -> &[i8]

Source§

fn as_flat_mut(&mut self) -> &mut [i8]

Implementors§