Skip to content

Commit 203b0e2

Browse files
committed
add back Graph.IEnumerable<Operation>
1 parent 27ab492 commit 203b0e2

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/TensorFlowNET.Core/Graphs/Graph.cs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@ all variables that are created during the construction of a graph. The caller
7575
/// then create a TensorFlow session to run parts of the graph across a set of local and remote devices.
7676
/// </summary>
7777
/// <remarks>https://www.tensorflow.org/guide/graphs <br></br>https://www.tensorflow.org/api_docs/python/tf/Graph</remarks>
78-
public partial class Graph : DisposableObject//, IEnumerable<Operation>
78+
public partial class Graph : DisposableObject,
79+
#if !SERIALIZABLE
80+
IEnumerable<Operation>
81+
#endif
7982
{
8083
private Dictionary<int, ITensorOrOperation> _nodes_by_id;
8184
public Dictionary<string, ITensorOrOperation> _nodes_by_name;
@@ -524,17 +527,19 @@ public override string ToString()
524527
}
525528
526529
return debugString;*/
527-
}
528-
529-
/*private IEnumerable<Operation> GetEnumerable()
530+
}
531+
532+
#if !SERIALIZABLE
533+
private IEnumerable<Operation> GetEnumerable()
530534
=> c_api_util.tf_operations(this);
531535

532536
IEnumerator<Operation> IEnumerable<Operation>.GetEnumerator()
533537
=> GetEnumerable().GetEnumerator();
534538

535539
IEnumerator IEnumerable.GetEnumerator()
536-
=> throw new NotImplementedException();*/
537-
540+
=> throw new NotImplementedException();
541+
#endif
542+
538543
public static implicit operator IntPtr(Graph graph)
539544
{
540545
return graph._handle;

0 commit comments

Comments
 (0)