[−][src]Trait xaynet::mask::IntoPrimitives
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.
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.
Implementors
impl IntoPrimitives<f32> for Model
[src]
fn into_primitives(
self
) -> Box<dyn Iterator<Item = Result<f32, ModelCastError>>>
[src]
self
) -> Box<dyn Iterator<Item = Result<f32, ModelCastError>>>
fn to_primitives(&self) -> Box<dyn Iterator<Item = Result<f32, ModelCastError>>>
[src]
impl IntoPrimitives<f64> for Model
[src]
fn into_primitives(
self
) -> Box<dyn Iterator<Item = Result<f64, ModelCastError>>>
[src]
self
) -> Box<dyn Iterator<Item = Result<f64, ModelCastError>>>
fn to_primitives(&self) -> Box<dyn Iterator<Item = Result<f64, ModelCastError>>>
[src]
impl IntoPrimitives<i32> for Model
[src]
fn into_primitives(
self
) -> Box<dyn Iterator<Item = Result<i32, ModelCastError>>>
[src]
self
) -> Box<dyn Iterator<Item = Result<i32, ModelCastError>>>
fn to_primitives(&self) -> Box<dyn Iterator<Item = Result<i32, ModelCastError>>>
[src]
impl IntoPrimitives<i64> for Model
[src]
fn into_primitives(
self
) -> Box<dyn Iterator<Item = Result<i64, ModelCastError>>>
[src]
self
) -> Box<dyn Iterator<Item = Result<i64, ModelCastError>>>