torch_geometric.transforms.ToDense

class ToDense(num_nodes: Optional[int] = None)[source]

Bases: BaseTransform

Converts a sparse adjacency matrix to a dense adjacency matrix with shape [num_nodes, num_nodes, *] (functional name: to_dense).

Parameters:

num_nodes (int, optional) – The number of nodes. If set to None, the number of nodes will get automatically inferred. (default: None)