diff --git a/src/TensorFlowNET.Core/Graphs/Graph.cs b/src/TensorFlowNET.Core/Graphs/Graph.cs index 9b6906aa..87a1424f 100644 --- a/src/TensorFlowNET.Core/Graphs/Graph.cs +++ b/src/TensorFlowNET.Core/Graphs/Graph.cs @@ -75,7 +75,10 @@ namespace Tensorflow /// then create a TensorFlow session to run parts of the graph across a set of local and remote devices. /// /// https://www.tensorflow.org/guide/graphs

https://www.tensorflow.org/api_docs/python/tf/Graph
- public partial class Graph : DisposableObject//, IEnumerable + public partial class Graph : DisposableObject, +#if !SERIALIZABLE + IEnumerable +#endif { private Dictionary _nodes_by_id; public Dictionary _nodes_by_name; @@ -524,17 +527,19 @@ namespace Tensorflow } return debugString;*/ - } - - /*private IEnumerable GetEnumerable() + } + +#if !SERIALIZABLE + private IEnumerable GetEnumerable() => c_api_util.tf_operations(this); IEnumerator IEnumerable.GetEnumerator() => GetEnumerable().GetEnumerator(); IEnumerator IEnumerable.GetEnumerator() - => throw new NotImplementedException();*/ - + => throw new NotImplementedException(); +#endif + public static implicit operator IntPtr(Graph graph) { return graph._handle;