pub fn load_weights<P>(
        graph: TaggerGraph,
        decoder: CategoricalEncoder<D, D::Encoding>,
        vectorizer: SentVectorizer,
        parameters_path: P,
    ) -> Result<Self, Error>
    where
        P: AsRef<Path>,
    {
        // Restore parameters.
        let path_tensor = prepare_path(parameters_path)?.into();
        let mut args = SessionRunArgs::new();
        args.add_feed(&graph.save_path_op, 0, &path_tensor);
        args.add_target(&graph.restore_op);
        let session = Self::new_session(&graph)?;
        session.run(&mut args).map_err(status_to_error)?;

        Ok(Tagger {
            graph,
            decoder,
            session,
            vectorizer,
        })
    }
/// Load a tagger with weights.
///
/// This constructor will load the model parameters (such as weights) from
/// the file specified in `parameters_path`.
Load a tagger with weights.
This constructor will load the model parameters (such as weights) from
the file specified in `parameters_path`.
Load a tagger with weights . This constructor will load the model parameters ( such as weights ) from the file specified in ` parameters_path ` .
pub fn load_weights<P>(
        graph: TaggerGraph,
        decoder: CategoricalEncoder<D, D::Encoding>,
        vectorizer: SentVectorizer,
        parameters_path: P,
    ) -> Result<Self, Error>
    where
        P: AsRef<Path>,
    {
        // Restore parameters.
        let path_tensor = prepare_path(parameters_path)?.into();
        let mut args = SessionRunArgs::new();
        args.add_feed(&graph.save_path_op, 0, &path_tensor);
        args.add_target(&graph.restore_op);
        let session = Self::new_session(&graph)?;
        session.run(&mut args).map_err(status_to_error)?;
        Ok(Tagger {
            graph,
            decoder,
            session,
            vectorizer,
        })
    }
pub fn load_weights < P > ( graph : TaggerGraph , decoder : CategoricalEncoder < D , D :: Encoding > , vectorizer : SentVectorizer , parameters_path : P , ) -> Result < Self , Error > where P : AsRef < Path > , { // Restore parameters. let path_tensor = prepare_path ( parameters_path ) ? . into ( ) ; let mut args = SessionRunArgs :: new ( ) ; args . add_feed ( & graph . save_path_op , 0 , & path_tensor ) ; args . add_target ( & graph . restore_op ) ; let session = Self :: new_session ( & graph ) ? ; session . run ( & mut args ) . map_err ( status_to_error ) ? ; Ok ( Tagger { graph , decoder , session , vectorizer , } ) }
Load a tagger with weights.
Load a tagger with weights .
graph
TaggerGraph
decoder
CategoricalEncoder<D, D::Encoding>
vectorizer
SentVectorizer
parameters_path
P