File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/TensorFlowNET.Keras/Datasets Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ public class Imdb
3131 /// <param name="oov_char"></param>
3232 /// <param name="index_from"></param>
3333 /// <returns></returns>
34- public DatasetPass load_data ( string path = "imdb.npz" ,
34+ public DatasetPass load_data ( string ? path = "imdb.npz" ,
3535 int num_words = - 1 ,
3636 int skip_top = 0 ,
3737 int maxlen = - 1 ,
@@ -42,7 +42,7 @@ public DatasetPass load_data(string path = "imdb.npz",
4242 {
4343 if ( maxlen == - 1 ) throw new InvalidArgumentError ( "maxlen must be assigned." ) ;
4444
45- var dst = Download ( ) ;
45+ var dst = path ?? Download ( ) ;
4646
4747 var lines = File . ReadAllLines ( Path . Combine ( dst , "imdb_train.txt" ) ) ;
4848 var x_train_string = new string [ lines . Length ] ;
@@ -55,7 +55,7 @@ public DatasetPass load_data(string path = "imdb.npz",
5555
5656 var x_train = keras . preprocessing . sequence . pad_sequences ( PraseData ( x_train_string ) , maxlen : maxlen ) ;
5757
58- File . ReadAllLines ( Path . Combine ( dst , "imdb_test.txt" ) ) ;
58+ lines = File . ReadAllLines ( Path . Combine ( dst , "imdb_test.txt" ) ) ;
5959 var x_test_string = new string [ lines . Length ] ;
6060 var y_test = np . zeros ( new int [ ] { lines . Length } , np . int64 ) ;
6161 for ( int i = 0 ; i < lines . Length ; i ++ )
You can’t perform that action at this time.
0 commit comments