Skip to content

Commit 92e8eb2

Browse files
hcurEsther2013
authored andcommitted
add _captures, external/internal_captures
1 parent fe4d943 commit 92e8eb2

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/TensorFlowNET.Core/Graphs/Graph.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,5 +560,23 @@ public static implicit operator IntPtr(Graph graph)
560560
{
561561
return graph._handle;
562562
}
563+
564+
public OrderedDictionary _captures => new OrderedDictionary();
565+
566+
public Tensor[] external_captures()
567+
{
568+
Tensor[] captures = new Tensor[this._captures.Count];
569+
ICollection inner = this._captures.Keys; // c[0]
570+
inner.CopyTo(captures, 0);
571+
return captures;
572+
}
573+
574+
public Tensor[] internal_captures()
575+
{
576+
Tensor[] captures = new Tensor[this._captures.Count];
577+
ICollection inner = this._captures.Values; // c[1]
578+
inner.CopyTo(captures, 0);
579+
return captures;
580+
}
563581
}
564582
}

0 commit comments

Comments
 (0)