Browse Source

add _captures, external/internal_captures

tags/v0.20
carb0n Esther Hu 5 years ago
parent
commit
92e8eb23b7
1 changed files with 18 additions and 0 deletions
  1. +18
    -0
      src/TensorFlowNET.Core/Graphs/Graph.cs

+ 18
- 0
src/TensorFlowNET.Core/Graphs/Graph.cs View File

@@ -560,5 +560,23 @@ namespace Tensorflow
{ {
return graph._handle; return graph._handle;
} }
public OrderedDictionary _captures => new OrderedDictionary();

public Tensor[] external_captures()
{
Tensor[] captures = new Tensor[this._captures.Count];
ICollection inner = this._captures.Keys; // c[0]
inner.CopyTo(captures, 0);
return captures;
}
public Tensor[] internal_captures()
{
Tensor[] captures = new Tensor[this._captures.Count];
ICollection inner = this._captures.Values; // c[1]
inner.CopyTo(captures, 0);
return captures;
}
} }
} }

Loading…
Cancel
Save