rllm.transforms.graph_transforms.EdgeTransform¶
- class rllm.transforms.graph_transforms.EdgeTransform[source]¶
Bases:
ABCBase class for edge-wise transformations on graph data.
The transform is applied to
adjfor homogeneous graphs, each validstore.adjfor heterogeneous graphs, or directly to a tensor input.- Shape:
GraphData:data.adjcan be dense or sparse and should follow the adjacency format expected by subclasses.HeteroGraphData:store.adjcan be dense or sparse and should follow the adjacency format expected by subclasses.torch.Tensor: if dense, input must be a square matrix with shape[N, N]; sparse tensors are forwarded as-is.
Examples:
class KeepSelfLoops(EdgeTransform): def forward(self, adj): return adj transform = KeepSelfLoops() out = transform(data)