torch_geometric.transforms.AddRemainingSelfLoops
- class AddRemainingSelfLoops(attr: str = 'edge_weight', fill_value: Union[float, Tensor, str] = 1.0)[source]
Bases:
BaseTransform
Adds remaining self-loops to the given homogeneous or heterogeneous graph (functional name:
add_remaining_self_loops
).- Parameters:
attr (str, optional) – The name of the attribute of edge weights or multi-dimensional edge features to pass to
torch_geometric.utils.add_remaining_self_loops()
. (default:"edge_weight"
)fill_value (float or Tensor or str, optional) – The way to generate edge features of self-loops (in case
attr != None
). If given asfloat
ortorch.Tensor
, edge features of self-loops will be directly given byfill_value
. If given asstr
, edge features of self-loops are computed by aggregating all features of edges that point to the specific node, according to a reduce operation. ("add"
,"mean"
,"min"
,"max"
,"mul"
). (default:1.
)