[][src]Trait xaynet::mask::IntoPrimitives

pub trait IntoPrimitives<P: 'static>: Sized {
    fn into_primitives(
        self
    ) -> Box<dyn Iterator<Item = Result<P, ModelCastError>>>;
fn to_primitives(
        &self
    ) -> Box<dyn Iterator<Item = Result<P, ModelCastError>>>; fn into_primitives_unchecked(self) -> Box<dyn Iterator<Item = P>> { ... } }

An interface to convert a collection of numerical values into an iterator of primitive values.

This trait is used to convert a Model, which has its own internal representation of the weights, into primitive types (f32, f64, i32, i64). The opposite trait is FromPrimitives.

Required methods

fn into_primitives(self) -> Box<dyn Iterator<Item = Result<P, ModelCastError>>>

Creates an iterator from numerical values that yields converted primitive values.

Errors

Yields an error for each numerical value that can't be converted into a primitive value.

fn to_primitives(&self) -> Box<dyn Iterator<Item = Result<P, ModelCastError>>>

Creates an iterator from numerical values that yields converted primitive values.

Errors

Yields an error for each numerical value that can't be converted into a primitive value.

Loading content...

Provided methods

fn into_primitives_unchecked(self) -> Box<dyn Iterator<Item = P>>

Consume this model and into an iterator that yields P values.

Panics

Panics if a numerical value can't be converted into a primitive value.

Loading content...

Implementors

impl IntoPrimitives<f32> for Model[src]

impl IntoPrimitives<f64> for Model[src]

impl IntoPrimitives<i32> for Model[src]

impl IntoPrimitives<i64> for Model[src]

Loading content...