X Tutup
Skip to content

Commit 0bcddfd

Browse files
committed
DefaultGraphStack: Minor perf-op
1 parent 3578c35 commit 0bcddfd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/TensorFlowNET.Core/Graphs/DefaultGraphStack.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public void set_controller(Graph @default)
3939

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

0 commit comments

Comments
 (0)
X Tutup