torch_geometric.transforms.AddRemainingSelfLoops
- class AddRemainingSelfLoops(attr: str = 'edge_weight', fill_value: Union[float, Tensor, str] = 1.0)[source]
Bases:
BaseTransform向给定的同质或异质图添加剩余的自环(功能名称:
add_remaining_self_loops)。- Parameters:
attr (str, optional) – 传递给
torch_geometric.utils.add_remaining_self_loops()的边权重或多维边特征的属性名称。 (默认:"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 asfloatortorch.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.)