(self, g)
| 628 | ) |
| 629 | |
| 630 | def __call__(self, g): |
| 631 | for c_etype in g.canonical_etypes: |
| 632 | g = self.transform_etype(c_etype, g) |
| 633 | |
| 634 | if self.new_etypes: |
| 635 | device = g.device |
| 636 | idtype = g.idtype |
| 637 | data_dict = dict() |
| 638 | |
| 639 | # Add self etypes |
| 640 | for ntype in g.ntypes: |
| 641 | nids = F.arange(0, g.num_nodes(ntype), idtype, device) |
| 642 | data_dict[(ntype, "self", ntype)] = (nids, nids) |
| 643 | |
| 644 | # Copy edges |
| 645 | for c_etype in g.canonical_etypes: |
| 646 | data_dict[c_etype] = g.edges(etype=c_etype) |
| 647 | |
| 648 | g = update_graph_structure(g, data_dict) |
| 649 | |
| 650 | return g |
| 651 | |
| 652 | |
| 653 | class RemoveSelfLoop(BaseTransform): |
nothing calls this directly
no test coverage detected