Skip to content

Commit 34ed751

Browse files
committed
release v0.10.7.2.
1 parent 0f26c77 commit 34ed751

File tree

5 files changed

+22
-15
lines changed

5 files changed

+22
-15
lines changed

src/TensorFlowNET.Core/Graphs/Graph.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,12 +445,12 @@ public void prevent_fetching(Operation op)
445445

446446
public void Dispose()
447447
{
448-
if (_handle != IntPtr.Zero)
448+
/*if (_handle != IntPtr.Zero)
449449
c_api.TF_DeleteGraph(_handle);
450450
451451
_handle = IntPtr.Zero;
452452
453-
GC.SuppressFinalize(this);
453+
GC.SuppressFinalize(this);*/
454454
}
455455

456456
/// <summary>

src/TensorFlowNET.Core/Sessions/Session.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,19 @@ public void close()
8383

8484
public void Dispose()
8585
{
86-
if (_session != IntPtr.Zero)
86+
IntPtr h = IntPtr.Zero;
87+
lock (this)
88+
{
89+
h = _session;
90+
_session = IntPtr.Zero;
91+
}
92+
if (h != IntPtr.Zero)
8793
{
8894
var status = new Status();
89-
c_api.TF_DeleteSession(_session, status);
95+
c_api.TF_DeleteSession(h, status);
96+
status.Check(true);
9097
}
91-
92-
_session = IntPtr.Zero;
98+
9399
GC.SuppressFinalize(this);
94100
}
95101

src/TensorFlowNET.Core/TensorFlowNET.Core.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<AssemblyName>TensorFlow.NET</AssemblyName>
66
<RootNamespace>Tensorflow</RootNamespace>
77
<TargetTensorFlow>1.14.0</TargetTensorFlow>
8-
<Version>0.10.7</Version>
8+
<Version>0.10.7.2</Version>
99
<Authors>Haiping Chen, Meinrad Recheis</Authors>
1010
<Company>SciSharp STACK</Company>
1111
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
@@ -17,7 +17,7 @@
1717
<PackageTags>TensorFlow, NumSharp, SciSharp, MachineLearning, TensorFlow.NET, C#</PackageTags>
1818
<Description>Google's TensorFlow full binding in .NET Standard.
1919
Docs: https://tensorflownet.readthedocs.io</Description>
20-
<AssemblyVersion>0.10.7.0</AssemblyVersion>
20+
<AssemblyVersion>0.10.7.2</AssemblyVersion>
2121
<PackageReleaseNotes>Changes since v0.9.0:
2222

2323
1. Added full connected Convolution Neural Network example.
@@ -36,7 +36,7 @@ Docs: https://tensorflownet.readthedocs.io</Description>
3636
14. Fix TF_String endcode and decode.
3737
15. Fix Tensor memory leak.</PackageReleaseNotes>
3838
<LangVersion>7.2</LangVersion>
39-
<FileVersion>0.10.7.0</FileVersion>
39+
<FileVersion>0.10.7.2</FileVersion>
4040
<PackageLicenseFile>LICENSE</PackageLicenseFile>
4141
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
4242
<SignAssembly>true</SignAssembly>

src/TensorFlowNET.Core/Tensors/Tensor.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ public int rank
135135
{
136136
var status = new Status();
137137
var output = _as_tf_output();
138-
return c_api.TF_GraphGetTensorNumDims(op.graph, output, status);
138+
int ndim = c_api.TF_GraphGetTensorNumDims(op.graph, output, status);
139+
status.Check();
140+
return ndim;
139141
}
140142
else
141143
{
@@ -394,15 +396,14 @@ public override string ToString()
394396

395397
public void Dispose()
396398
{
397-
IntPtr h=IntPtr.Zero;
399+
IntPtr h = IntPtr.Zero;
398400
lock (this)
399401
{
400402
h = _handle;
401-
_handle=IntPtr.Zero;
403+
_handle = IntPtr.Zero;
402404
}
403405
if (h != IntPtr.Zero)
404406
c_api.TF_DeleteTensor(h);
405-
406407
GC.SuppressFinalize(this);
407408
}
408409

test/TensorFlowNET.Examples/ImageProcessing/RetrainImageClassifier.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ public bool Run()
8383
#region For debug purpose
8484

8585
// predict images
86-
Predict(null);
86+
// Predict(null);
8787

8888
// load saved pb and test new images.
89-
Test(null);
89+
// Test(null);
9090

9191
#endregion
9292

0 commit comments

Comments
 (0)