torch_geometric.transforms.RemoveDuplicatedEdges

class RemoveDuplicatedEdges(key: Union[str, List[str]] = ['edge_attr', 'edge_weight'], reduce: str = 'add')[source]

Bases: BaseTransform

Removes duplicated edges from a given homogeneous or heterogeneous graph. Useful to clean-up known repeated edges/self-loops in common benchmark datasets, e.g., in ogbn-products. (functional name: remove_duplicated_edges).

Parameters:
  • key (str or [str], optional) – The name of edge attribute(s) to merge in case of duplication. (default: ["edge_weight", "edge_attr"])

  • reduce (str, optional) – The reduce operation to use for merging edge attributes ("add", "mean", "min", "max", "mul"). (default: "add")