diff --git a/src/TensorFlowNET.Core/Graphs/DefaultGraphStack.cs b/src/TensorFlowNET.Core/Graphs/DefaultGraphStack.cs index 33a3aaa3..66419b3e 100644 --- a/src/TensorFlowNET.Core/Graphs/DefaultGraphStack.cs +++ b/src/TensorFlowNET.Core/Graphs/DefaultGraphStack.cs @@ -27,24 +27,24 @@ namespace Tensorflow /// public class DefaultGraphStack { - private readonly List stack = new List(); + private readonly List _stack = new List(); public void set_controller(Graph @default) { - if (!stack.Exists(x => x.Graph == @default)) - stack.Add(new StackModel {Graph = @default, IsDefault = true}); + if (!_stack.Exists(x => x.Graph == @default)) + _stack.Add(new StackModel {Graph = @default, IsDefault = true}); - foreach (var s in stack) + foreach (var s in _stack) s.IsDefault = s.Graph == @default; } public Graph get_controller() { - if (stack.Count(x => x.IsDefault) == 0) - stack.Add(new StackModel {Graph = tf.Graph(), IsDefault = true}); - for (var i = stack.Count - 1; i >= 0; i--) + if (_stack.Count(x => x.IsDefault) == 0) + _stack.Add(new StackModel {Graph = tf.Graph(), IsDefault = true}); + for (var i = _stack.Count - 1; i >= 0; i--) { - var x = stack[i]; + var x = _stack[i]; if (x.IsDefault) return x.Graph; } @@ -54,16 +54,16 @@ namespace Tensorflow public bool remove(Graph g) { - if (stack.Count == 0) + if (_stack.Count == 0) return false; - var sm = stack.Find(model => model.Graph == g); - return sm != null && stack.Remove(sm); + var sm = _stack.Find(model => model.Graph == g); + return sm != null && _stack.Remove(sm); } public void reset() { - stack.Clear(); + _stack.Clear(); } private class StackModel