(idtype)
| 195 | |
| 196 | @parametrize_idtype |
| 197 | def test_issue1287(idtype): |
| 198 | # reproduce https://github.com/dmlc/dgl/issues/1287. |
| 199 | # setting features after remove nodes |
| 200 | g = create_graph(idtype, 5) |
| 201 | g.add_edges([0, 2, 3, 1, 1], [1, 0, 3, 1, 0]) |
| 202 | g.remove_nodes([0, 1]) |
| 203 | g.ndata["h"] = F.randn((g.num_nodes(), 3)) |
| 204 | g.edata["h"] = F.randn((g.num_edges(), 2)) |
| 205 | |
| 206 | # remove edges |
| 207 | g = create_graph(idtype, 5) |
| 208 | g.add_edges([0, 2, 3, 1, 1], [1, 0, 3, 1, 0]) |
| 209 | g.remove_edges([0, 1]) |
| 210 | g = g.to(F.ctx()) |
| 211 | g.ndata["h"] = F.randn((g.num_nodes(), 3)) |
| 212 | g.edata["h"] = F.randn((g.num_edges(), 2)) |
| 213 | |
| 214 | |
| 215 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected