public static Graph set_default_graph(Graph g) { if (default_graph_stack == null) { default_graph_stack = new DefaultGraphStack(); } return(default_graph_stack.get_controller(g)); }
public static Graph peak_default_graph() { if (default_graph_stack == null) { default_graph_stack = new DefaultGraphStack(); } return(default_graph_stack.peak_controller()); }
/// <summary> /// Returns the default graph for the current thread. /// /// The returned graph will be the innermost graph on which a /// `Graph.as_default()` context has been entered, or a global default /// graph if none has been explicitly created. /// /// NOTE: The default graph is a property of the current thread.If you /// create a new thread, and wish to use the default graph in that /// thread, you must explicitly add a `with g.as_default():` in that /// thread's function. /// </summary> /// <returns></returns> public static Graph get_default_graph() { if (default_graph_stack == null) { default_graph_stack = new DefaultGraphStack(); } return(default_graph_stack.get_default()); }