Browse Source

ops.uid: Use Interlocked.Increment instead of ++

tags/v0.12
Eli Belash 6 years ago
parent
commit
a7cdf6e1a2
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      src/TensorFlowNET.Core/ops.cs

+ 2
- 1
src/TensorFlowNET.Core/ops.cs View File

@@ -93,6 +93,7 @@ namespace Tensorflow
//return _default_graph_stack.get_default()
return default_graph_stack.get_controller();
}

public static Graph set_default_graph(Graph graph)
{
//TODO: original source does not have a 'set_default_graph' and indicates there should be a _default_graph_stack!
@@ -311,7 +312,7 @@ namespace Tensorflow
/// <returns></returns>
public static int uid()
{
return uid_number++;
return Interlocked.Increment(ref uid_number);
}

public static void colocate_with(bool ignore_existing = false)


Loading…
Cancel
Save