Browse Source

DefaultGraphStack: Minor perf-op

tags/v0.12
Eli Belash 6 years ago
parent
commit
0bcddfdfd7
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/TensorFlowNET.Core/Graphs/DefaultGraphStack.cs

+ 1
- 1
src/TensorFlowNET.Core/Graphs/DefaultGraphStack.cs View File

@@ -39,7 +39,7 @@ namespace Tensorflow


public Graph get_controller() public Graph get_controller()
{ {
if (_stack.Count(x => x.IsDefault) == 0)
if (_stack.Count == 0 || _stack.Count(x => x.IsDefault) == 0)
_stack.Add(new StackModel {Graph = tf.Graph(), IsDefault = true}); _stack.Add(new StackModel {Graph = tf.Graph(), IsDefault = true});
for (var i = _stack.Count - 1; i >= 0; i--) for (var i = _stack.Count - 1; i >= 0; i--)
{ {


Loading…
Cancel
Save