Struct primitiv::Model
[−]
[src]
pub struct Model { /* fields omitted */ }
Set of parameters and specific algorithms.
Methods
impl Model
[src]
pub fn new() -> Self
[src]
Creates a new Model object.
pub fn load<P: AsRef<Path>>(&mut self, path: P, with_stats: bool) -> Result<()>
[src]
Loads all parameters from a file.
pub fn load_on<P: AsRef<Path>, D: Device>(
&mut self,
path: P,
with_stats: bool,
device: Option<&mut D>
) -> Result<()>
[src]
&mut self,
path: P,
with_stats: bool,
device: Option<&mut D>
) -> Result<()>
Loads all parameters from a file.
pub fn save<P: AsRef<Path>>(&self, path: P, with_stats: bool) -> Result<()>
[src]
Saves all parameters to a file.
pub fn add_parameter(&mut self, name: &str, param: &mut Parameter)
[src]
Registers a new parameter.
pub fn add_submodel<M: AsMut<Model>>(&mut self, name: &str, model: &mut M)
[src]
Registers a new submodel.
pub fn get_parameter(&mut self, name: &str) -> Parameter
[src]
Retrieves a parameter with specified name.
pub fn find_parameter(&mut self, names: &[&str]) -> Parameter
[src]
Recursively searches a parameter with specified name hierarchy.
pub fn get_submodel(&mut self, name: &str) -> Model
[src]
Retrieves a submodel with specified name.
pub fn find_submodel(&mut self, names: &[&str]) -> Model
[src]
Recursively searches a submodel with specified name hierarchy.
Trait Implementations
impl Debug for Model
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more