Skip to main content

read_model

Function read_model 

Source
pub fn read_model<const IN: usize, const OUT: usize>(
    reader: impl Read,
) -> Result<NeuralNetwork<IN, OUT>, ModelError>
Expand description

Reads one model from any reader, checking that its shape matches IN and OUT.

Reading stops where the model ends, so several models can be read one after the other from the same stream. Wrap slow readers such as files in a std::io::BufReader.

ยงErrors

The same as load_model, except that data after the model is left unread rather than reported.