File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
TensorFlowNET.Core/Sessions
TensorFlowNet.Benchmarks/Leak Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ public Session as_default()
3939
4040 public static Session LoadFromSavedModel ( string path )
4141 {
42- using var graph = new Graph ( ) ;
42+ var graph = new Graph ( ) ;
4343 using var status = new Status ( ) ;
4444 using var opt = c_api . TF_NewSessionOptions ( ) ;
4545
Original file line number Diff line number Diff line change 1010
1111namespace Tensorflow . Benchmark . Leak
1212{
13-
13+ /// <summary>
14+ /// https://github.com/SciSharp/TensorFlow.NET/issues/418
15+ /// </summary>
1416 public class SavedModelCleanup
1517 {
1618 [ Benchmark ]
@@ -22,6 +24,8 @@ public void Run()
2224 for ( var i = 0 ; i < 1024 ; i ++ )
2325 {
2426 using var sess = Session . LoadFromSavedModel ( ClassifierModelPath ) ;
27+ // destory graph
28+ using var g = sess . graph ;
2529 }
2630 }
2731 }
You can’t perform that action at this time.
0 commit comments