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)  

I print and the result was
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, works fine. Does the operation violate some rules of DGL? is an inplace operation. (Maybe we should change this). Therefore it doesn’t return anything, but directly move g to devices.