@@ -10,26 +10,25 @@ namespace TensorFlowNET.UnitTest
1010 public class TrainSaverTest : Python
1111 {
1212 [ TestMethod ]
13- public void WriteGraph ( )
13+ public void ExportGraph ( )
1414 {
1515 var v = tf . Variable ( 0 , name : "my_variable" ) ;
1616 var sess = tf . Session ( ) ;
17- tf . train . write_graph ( sess . graph , "/tmp/my-model" , "train .pbtxt" ) ;
17+ tf . train . write_graph ( sess . graph , "/tmp/my-model" , "train1 .pbtxt" ) ;
1818 }
1919
2020 [ TestMethod ]
2121 public void ImportGraph ( )
2222 {
2323 var v = tf . Variable ( 0 , name : "my_variable" ) ;
2424 var sess = tf . Session ( ) ;
25- tf . train . write_graph ( sess . graph , "/tmp/my-model" , "train .pbtxt" ) ;
25+ tf . train . write_graph ( sess . graph , "/tmp/my-model" , "train2 .pbtxt" ) ;
2626 }
2727
2828 [ TestMethod ]
29- public void SaveSimple ( )
29+ public void Save1 ( )
3030 {
31- var w1 = tf . Variable ( tf . random_normal ( new int [ ] { 2 } ) , name : "w1" ) ;
32- var w2 = tf . Variable ( tf . random_normal ( new int [ ] { 5 } ) , name : "w2" ) ;
31+ var w1 = tf . Variable ( 0 , name : "save1" ) ;
3332
3433 var init_op = tf . global_variables_initializer ( ) ;
3534
@@ -41,13 +40,13 @@ public void SaveSimple()
4140 sess . run ( init_op ) ;
4241
4342 // Save the variables to disk.
44- var save_path = saver . save ( sess , "/tmp/model .ckpt" ) ;
43+ var save_path = saver . save ( sess , "/tmp/model1 .ckpt" ) ;
4544 Console . WriteLine ( $ "Model saved in path: { save_path } ") ;
4645 } ) ;
4746 }
4847
4948 [ TestMethod ]
50- public void Save ( )
49+ public void Save2 ( )
5150 {
5251 var v1 = tf . get_variable ( "v1" , shape : new TensorShape ( 3 ) , initializer : tf . zeros_initializer ) ;
5352 var v2 = tf . get_variable ( "v2" , shape : new TensorShape ( 5 ) , initializer : tf . zeros_initializer ) ;
@@ -69,7 +68,7 @@ public void Save()
6968 dec_v2 . op . run ( ) ;
7069
7170 // Save the variables to disk.
72- var save_path = saver . save ( sess , "/tmp/model .ckpt" ) ;
71+ var save_path = saver . save ( sess , "/tmp/model2 .ckpt" ) ;
7372 Console . WriteLine ( $ "Model saved in path: { save_path } ") ;
7473 } ) ;
7574 }
0 commit comments