Skip to main content

CustomLayer

Trait CustomLayer 

Source
pub trait CustomLayer: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn layer_type(&self) -> &str;
    fn input_shape(&self) -> Vec<i64>;
    fn output_shape(&self, input_shape: &[i64]) -> Vec<i64>;
    fn initialize_parameters(&self) -> Result<HashMap<String, TensorRef>>;
    fn config(&self) -> Value;
}
Expand description

Custom layer interface for advanced builders

Required Methods§

Source

fn name(&self) -> &str

Get layer name

Source

fn layer_type(&self) -> &str

Get layer type

Source

fn input_shape(&self) -> Vec<i64>

Get input shape requirements

Source

fn output_shape(&self, input_shape: &[i64]) -> Vec<i64>

Get output shape

Source

fn initialize_parameters(&self) -> Result<HashMap<String, TensorRef>>

Initialize layer parameters

Source

fn config(&self) -> Value

Get layer configuration

Implementors§