SubModel2

Trait SubModel2 

Source
pub trait SubModel2 {
    type Config;
    type Input1;
    type Input2;
    type Output;

    // Required methods
    fn build(var_store: &VarStore, config: Self::Config) -> Self;
    fn clone_with_var_store(&self, var_store: &VarStore) -> Self;
    fn forward(
        &self,
        input1: &Self::Input1,
        input2: &Self::Input2,
    ) -> Self::Output;
}
Expand description

Neural network model that can be initialized with VarStore and configuration.

The difference from SubModel is that this trait takes two inputs.

Required Associated Types§

Source

type Config

Configuration from which SubModel2 is constructed.

Source

type Input1

Input of the SubModel2.

Source

type Input2

Input of the SubModel2.

Source

type Output

Output of the SubModel2.

Required Methods§

Source

fn build(var_store: &VarStore, config: Self::Config) -> Self

Source

fn clone_with_var_store(&self, var_store: &VarStore) -> Self

Clones SubModel2 with VarStore.

Source

fn forward(&self, input1: &Self::Input1, input2: &Self::Input2) -> Self::Output

A generalized forward function.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§