SubModel2

Trait SubModel2 

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

    // Required methods
    fn build(vb: VarBuilder<'_>, config: Self::Config) -> Self;
    fn forward(
        &self,
        input1: &Self::Input1,
        input2: &Self::Input2,
    ) -> Self::Output;
}
Expand description

Neural network model not owing its VarMap internally.

The difference from SubModel1 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(vb: VarBuilder<'_>, config: Self::Config) -> Self

Builds SubModel2.

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§