concision_core/nn/model/
module.rs1use crate::{Config, Predict};
6
7pub type ModuleDyn<C, P> = Box<dyn Module<Config = C, Params = P>>;
8pub type DynModuleExt<X, Y, C, P> = Box<dyn ModuleExt<X, Config = C, Output = Y, Params = P>>;
9pub type Stack<X, Y, C, P> = Vec<Box<dyn ModuleExt<X, Config = C, Output = Y, Params = P>>>;
10
11pub trait Module {
15 type Config: Config;
16 type Params;
17
18 fn config(&self) -> &Self::Config;
19
20 fn params(&self) -> &Self::Params;
21
22 fn params_mut(&mut self) -> &mut Self::Params;
23}
24
25pub trait ModuleExt<T>: Module + Predict<T> {}
26
27impl<T, M> ModuleExt<T> for M where M: Module + Predict<T> {}