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()
39
39
40
40
public static Session LoadFromSavedModel ( string path )
41
41
{
42
- using var graph = new Graph ( ) ;
42
+ var graph = new Graph ( ) ;
43
43
using var status = new Status ( ) ;
44
44
using var opt = c_api . TF_NewSessionOptions ( ) ;
45
45
Original file line number Diff line number Diff line change 10
10
11
11
namespace Tensorflow . Benchmark . Leak
12
12
{
13
-
13
+ /// <summary>
14
+ /// https://github.com/SciSharp/TensorFlow.NET/issues/418
15
+ /// </summary>
14
16
public class SavedModelCleanup
15
17
{
16
18
[ Benchmark ]
@@ -22,6 +24,8 @@ public void Run()
22
24
for ( var i = 0 ; i < 1024 ; i ++ )
23
25
{
24
26
using var sess = Session . LoadFromSavedModel ( ClassifierModelPath ) ;
27
+ // destory graph
28
+ using var g = sess . graph ;
25
29
}
26
30
}
27
31
}
You can’t perform that action at this time.
0 commit comments