dgl.DGLGraph.clear¶
-
DGLGraph.
clear
()[source]¶ Remove all nodes and edges, as well as their features, from the graph.
Examples
>>> G = dgl.DGLGraph() >>> G.add_nodes(4) >>> G.add_edges([0, 1, 2, 3], [1, 2, 3, 0]) >>> G.number_of_nodes() 4 >>> G.number_of_edges() 4 >>> G.clear() >>> G.number_of_nodes() 0 >>> G.number_of_edges() 0