using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using TF_DataType = Tensorflow.DataType;
namespace Tensorflow
{
///
/// TensorFlow uses a dataflow graph to represent your computation in terms of the dependencies between individual operations.
/// This leads to a low-level programming model in which you first define the dataflow graph,
/// 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
///
public class Graph
{
private IntPtr _handle;
private Dictionary _nodes_by_id;
private Dictionary _nodes_by_name;
private Dictionary _names_in_use;
public int _version;
private int _next_id_counter;
private List _unfetchable_ops = new List();
private string _name_stack;
public Graph(IntPtr graph)
{
_handle = graph;
_nodes_by_id = new Dictionary();
_nodes_by_name = new Dictionary();
_names_in_use = new Dictionary();
}
public T as_graph_element(T obj, bool allow_tensor = true, bool allow_operation = true)
{
return _as_graph_element_locked(obj, allow_tensor, allow_operation);
}
private Func