Skip to main content

Layer

Trait Layer 

Source
pub trait Layer {
    // Required methods
    fn forward(&self, input: &Tensor) -> CnnResult<Tensor>;
    fn name(&self) -> &'static str;

    // Provided method
    fn num_params(&self) -> usize { ... }
}
Expand description

Trait for all neural network layers

Required Methods§

Source

fn forward(&self, input: &Tensor) -> CnnResult<Tensor>

Perform the forward pass

Source

fn name(&self) -> &'static str

Get the layer name

Provided Methods§

Source

fn num_params(&self) -> usize

Get the number of parameters

Implementors§