Trait rai_core::nn::WithParams

source ·
pub trait WithParams {
    // Required methods
    fn gather_by_id(&self, params: &mut HashMap<usize, Tensor>);
    fn update_by_id(&self, params: &mut HashMap<usize, Tensor>);
    fn gather_by_name(
        &self,
        params: &mut HashMap<String, Tensor>,
        prefix: &str,
        name: &str
    );
    fn update_by_name(
        &self,
        params: &mut HashMap<String, Tensor>,
        prefix: &str,
        name: &str
    );
}

Required Methods§

source

fn gather_by_id(&self, params: &mut HashMap<usize, Tensor>)

source

fn update_by_id(&self, params: &mut HashMap<usize, Tensor>)

source

fn gather_by_name( &self, params: &mut HashMap<String, Tensor>, prefix: &str, name: &str )

source

fn update_by_name( &self, params: &mut HashMap<String, Tensor>, prefix: &str, name: &str )

Implementations on Foreign Types§

source§

impl<T> WithParams for Option<T>
where T: WithParams,

source§

fn gather_by_id(&self, params: &mut HashMap<usize, Tensor>)

source§

fn update_by_id(&self, params: &mut HashMap<usize, Tensor>)

source§

fn gather_by_name( &self, params: &mut HashMap<String, Tensor>, prefix: &str, name: &str )

source§

fn update_by_name( &self, params: &mut HashMap<String, Tensor>, prefix: &str, name: &str )

source§

impl<T> WithParams for Vec<T>
where T: WithParams,

source§

fn gather_by_id(&self, params: &mut HashMap<usize, Tensor>)

source§

fn update_by_id(&self, params: &mut HashMap<usize, Tensor>)

source§

fn gather_by_name( &self, params: &mut HashMap<String, Tensor>, prefix: &str, name: &str )

source§

fn update_by_name( &self, params: &mut HashMap<String, Tensor>, prefix: &str, name: &str )

Implementors§

source§

impl WithParams for Tensor

source§

impl<T> WithParams for T
where T: Module,