From b0969cf3d4c38e801b4141e5fc32b44bc7b7af08 Mon Sep 17 00:00:00 2001 From: stevemadere Date: Fri, 21 May 2004 01:44:32 +0000 Subject: [PATCH] Fixed a bug in mlp::net::load() that prevented loading of multiple nets from the same stream. --- eo/app/gprop/mlp.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eo/app/gprop/mlp.h b/eo/app/gprop/mlp.h index 544935d7..a3d841bd 100644 --- a/eo/app/gprop/mlp.h +++ b/eo/app/gprop/mlp.h @@ -251,10 +251,12 @@ namespace mlp { init (num_inputs,num_outputs,layer_sizes); // skip forward to pass up opening '<' char char c=' '; - while (c!='<') { is >> c;} + while (c!='<' && !is.eof()) { is >> c;} for (iterator l =begin() ; l != end(); l++) { is >> *l; } + do { is >> c; } while (c == ' ' && !is.eof()); + assert(c == '>'); } void init( unsigned num_inputs,