[][src]Trait crabsformer::builders::FourDimensional

pub trait FourDimensional<T> where
    T: Num + FromPrimitive + Copy
{ fn four_dim() -> FourDimensionalVectorParams<T>; }

Four-dimensional vector builder

Required methods

fn four_dim() -> FourDimensionalVectorParams<T>

Four-dimensional vector builder. It returns FourDimensionalVectorParams with default value:

This example is not tested
FourDimensionalVectorParams{
    shape: None,
    default_value: None,
}

The parameter can be configured using the following methods: with_shape(), full_of(), ones() and zeros(). After the four-dimensional vector parameters are configured, use generate() to generate the four-dimensional vector.

Examples

// Generate a four-dimensional vector with shape [1, 1, 1, 2]
// filled with zeros; i32 can be changed into any
// numeric data types.
let v: Vec<Vec<Vec<Vec<i32>>>> = Vec::four_dim()
    .with_shape([1, 1, 1, 2])
    .ones()
    .generate();

assert_eq!(v, [[[[1, 1]]]]);
Loading content...

Implementations on Foreign Types

impl<T> FourDimensional<T> for Vec<Vec<Vec<Vec<T>>>> where
    T: Num + FromPrimitive + Copy
[src]

Loading content...

Implementors

Loading content...