@@ -26,13 +26,18 @@ public class TensorBoardFileWriter
26
26
27
27
[ DllImport ( "TensorBoardFileWriter.dll" ) ]
28
28
public static extern void WriteValue ( IntPtr writer , [ MarshalAs ( UnmanagedType . LPWStr ) ] string name , float value , long step ) ;
29
+
30
+ [ DllImport ( "TensorBoardFileWriter.dll" ) ]
31
+ public static extern void Flush ( IntPtr writer ) ;
29
32
30
33
private readonly IntPtr writer ;
31
34
public TensorBoardFileWriter ( string dir ) => this . writer = OpenWriter ( dir ) ;
32
35
33
36
~ TensorBoardFileWriter ( ) => CloseWriter ( this . writer ) ;
34
37
35
- public void WriteValue ( string name , float value , long step ) => WriteValue ( this . writer , name , value , step ) ;
38
+ public void WriteValue ( string name , float value , long step ) => WriteValue ( this . writer , name , value , step ) ;
39
+
40
+ public void Flush ( ) => Flush ( this . writer ) ;
36
41
37
42
// create ProgressWriterVector with attached native progress writer
38
43
public static ProgressWriterVector CreateVector ( string path , Function network )
@@ -102,6 +107,7 @@ static public void TrainAndEvaluate(DeviceDescriptor device)
102
107
103
108
progressWriter . WriteValue ( "random1" , ( float ) random . Next ( ) , minibatchCount ) ;
104
109
progressWriter . WriteValue ( "random2" , ( float ) random . Next ( ) , minibatchCount ) ;
110
+ progressWriter . Flush ( ) ;
105
111
}
106
112
107
113
// test and validate the model
0 commit comments