| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -40,10 +40,7 @@ public void SetInputs(Dictionary<Operation, Tensor> inputs) | |||
| 40 | 40 | ||
| 41 | 41 | private void DeleteInputValues() | |
| 42 | 42 | { | |
| 43 | - for (var i = 0; i < input_values_.Count; ++i) | ||
| 44 | - { | ||
| 45 | - input_values_[i].Dispose(); | ||
| 46 | - } | ||
| 43 | + //clearing is enough as they will be disposed by the GC unless they are referenced else-where. | ||
| 47 | 44 | input_values_.Clear(); | |
| 48 | 45 | } | |
| 49 | 46 | ||
@@ -60,11 +57,7 @@ public void SetOutputs(TF_Output[] outputs) | |||
| 60 | 57 | ||
| 61 | 58 | private void ResetOutputValues() | |
| 62 | 59 | { | |
| 63 | - for (var i = 0; i < output_values_.Count; ++i) | ||
| 64 | - { | ||
| 65 | - if (output_values_[i] != IntPtr.Zero) | ||
| 66 | - output_values_[i].Dispose(); | ||
| 67 | - } | ||
| 60 | + //clearing is enough as they will be disposed by the GC unless they are referenced else-where. | ||
| 68 | 61 | output_values_.Clear(); | |
| 69 | 62 | } | |
| 70 | 63 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments