From 92e8eb23b7dbb0c9f114f9fd86f01a1a946259ea Mon Sep 17 00:00:00 2001 From: carb0n <58676303+carb0n@users.noreply.github.com> Date: Tue, 4 Aug 2020 00:24:30 -0400 Subject: [PATCH] add _captures, external/internal_captures --- src/TensorFlowNET.Core/Graphs/Graph.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/TensorFlowNET.Core/Graphs/Graph.cs b/src/TensorFlowNET.Core/Graphs/Graph.cs index 7fbdf229..f45fddaf 100644 --- a/src/TensorFlowNET.Core/Graphs/Graph.cs +++ b/src/TensorFlowNET.Core/Graphs/Graph.cs @@ -560,5 +560,23 @@ namespace Tensorflow { 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; + } } }