Trait greenglas::transformer::Transformer [] [src]

pub trait Transformer {
    fn transform_to_vec(&self) -> Vec<f32>;

    fn transform(
        &self,
        shape: &[usize]
    ) -> Result<SharedTensor<f32>, TransformerError> { ... } fn write_to_memory<T: NumCast + Copy>(
        mem: &mut FlatBox,
        data: &[T]
    ) -> Result<(), TransformerError> { ... } fn write_to_memory_offset<T: NumCast + Copy>(
        mem: &mut FlatBox,
        data: &[T],
        offset: usize
    ) -> Result<(), TransformerError> { ... } }

The Transformer Trait

Gets implemented for all Transformable Data Types. Allows all Transformable Data Types to get transformed into a Blob.

Required Methods

Transforms the non-numeric data into a numeric Vec

Provided Methods

Transforms non-numeric data into a numeric SharedTensor

The shape attribute is used to control the dimensions/shape of the Blob. It returns an Error, when the expected capacity (defined by the shape) differs from the observed one.

Write into a native Coaster Memory.

Write into a native Coaster Memory with a offset.

Implementors