Browse Source

CSession: Revmoed Dispose of Input and Ouput values in DeleteInputValues, ResetOutputValues

They are managed by GC.
tags/v0.12
Eli Belash 6 years ago
parent
commit
7e46d4fa93
1 changed files with 2 additions and 9 deletions
  1. +2
    -9
      test/TensorFlowNET.UnitTest/CSession.cs

+ 2
- 9
test/TensorFlowNET.UnitTest/CSession.cs View File

@@ -40,10 +40,7 @@ namespace TensorFlowNET.UnitTest

private void DeleteInputValues()
{
for (var i = 0; i < input_values_.Count; ++i)
{
input_values_[i].Dispose();
}
//clearing is enough as they will be disposed by the GC unless they are referenced else-where.
input_values_.Clear();
}

@@ -60,11 +57,7 @@ namespace TensorFlowNET.UnitTest

private void ResetOutputValues()
{
for (var i = 0; i < output_values_.Count; ++i)
{
if (output_values_[i] != IntPtr.Zero)
output_values_[i].Dispose();
}
//clearing is enough as they will be disposed by the GC unless they are referenced else-where.
output_values_.Clear();
}



Loading…
Cancel
Save