From_networkx return none

I have a list of edge,I use nx.from_edgelist to create a networkx graph and the networkx graph was seemingly created correctlly,but then I use the from_networkx function in DGL to get a DGLGrpah but the result was None,and here is my code,was anything wrong?

g =  dgl.DGLGraph()
graph = nx.from_edgelist(edge_list)  
g.from_networkx(graph)

I print nx.info(graph) and the result was
Name:
Type: Graph
Number of nodes: 1915
Number of edges: 3086
Average degree: 3.2230

I’m not sure what’s the problem. However you can directly add edges to DGLGraph by g.add_edges(src_list, dst_list) after g.add_nodes(num_nodes).

I check the pytorch code, it seems that if I add an operation .to(self.deivce) on the DGLgraph,the result will be None. However,for a tensor called features, features.to(self.deivce) works fine. Does the operation violate some rules of DGL?

g.to(device) is an inplace operation. (Maybe we should change this). Therefore it doesn’t return anything, but directly move g to devices.