馃殌 The feature, motivation and pitch
PyG currently accepts torch.LongTensor: edge_index and torch_sparse.SparseTensor: adj in MessagePassing, which limits its flexibility for users who use native PyTorch SparseTensor. As such, an additional step is required for them to convert one to another.
The goal of this roadmap is to track the integration of native PyTorch SparseTensor support into PyG. After integration, the edge_index in MessagePassing can also accept PyTorch SparseTensor while allowing backpropagation like torch_sparse.SparseTensor.
General Roadmap
Implementations
Utility functions
is_torch_sparse_tensor function. Since both strided (dense) or sparse_coo tensors are instances of torch.Tensor, there should be a function to distinguish between two different inputs, i.e., LongTensor edge_index and SparseTensor adj (Add spmm and is_torch_sparse_tensor聽#5906 ).
spmm function: sparse-dense matrix multiplication supporting both torch_sparse and PyTorch SparseTensor. For PyTorch SparseTensor, currently only sum and mean aggregations are allowed (Add spmm and is_torch_sparse_tensor聽#5906 , Added mean reduction to utils.spmm for PyTorch Sparse Tensor聽#6868 , PyTorch Sparse Tensor support: HANConv, GATv2Conv, HGTConv, GMMConv, GPSConv, and RGATConv聽#6932 ).
is_sparse_tensor: check for either torch.sparse.Tensor or torch_sparse.SparseTensor (Add is_sparse and to_torch_coo_tensor聽#6003 ).
to_torch_coo_tensor: convert edge_index to torch.sparse.Tensor (coo format) (Add is_sparse and to_torch_coo_tensor聽#6003 ).
Support torch.sparse.Tensor input of add_self_loop, remove_self_loop, and maybe_num_nodes (Added PyTorch Sparse Tensor support for remove_self_loops, add_self_loops, and maybe_num_nodes聽#6847 )
torch_geometric.nn.*
MessagePassing (Add PyTorch SparseTensor support for MessagePassing聽#5944 , Pytorch Sparse tensor support: AntiSymmetricConv, CGConv, and TransformerConv聽#6633 )
GCNConv (Add PyTorch SparseTensor support for GCNConv and gcn_norm聽#6033 )
AGNNConv (Pytorch Sparse tensor support: ClusterGCN, SAGEConv, AGNNConv, APPNP, and FeaStConv聽#6874 )
APPNP (Pytorch Sparse tensor support: ClusterGCN, SAGEConv, AGNNConv, APPNP, and FeaStConv聽#6874 )
AntiSymmetricConv (Pytorch Sparse tensor support: AntiSymmetricConv, CGConv, and TransformerConv聽#6633 )
ARMAConv
CGConv (Pytorch Sparse tensor support: AntiSymmetricConv, CGConv, and TransformerConv聽#6633 )
ChebConv
ClusterGCNConv (Pytorch Sparse tensor support: ClusterGCN, SAGEConv, AGNNConv, APPNP, and FeaStConv聽#6874 )
DNAConv (Pytorch Sparse tensor support: DNAConv, EdgeConv, EGConv, and FAConv聽#6748 )
EdgeConv (Pytorch Sparse tensor support: DNAConv, EdgeConv, EGConv, and FAConv聽#6748 )
EGConv (Pytorch Sparse tensor support: DNAConv, EdgeConv, EGConv, and FAConv聽#6748 )
FAConv (Pytorch Sparse tensor support: DNAConv, EdgeConv, EGConv, and FAConv聽#6748 )
FeaStConv (Pytorch Sparse tensor support: ClusterGCN, SAGEConv, AGNNConv, APPNP, and FeaStConv聽#6874 )
FiLMConv
FusedGATConv
GATConv (Pytorch Sparse tensor support: GATConv, GatedGraphConv, GCN2Conv, and GENConv聽#6897 )
GatedGraphConv (Pytorch Sparse tensor support: GATConv, GatedGraphConv, GCN2Conv, and GENConv聽#6897 )
GATv2Conv (PyTorch Sparse Tensor support: HANConv, GATv2Conv, HGTConv, GMMConv, GPSConv, and RGATConv聽#6932 )
GCN2Conv (Pytorch Sparse tensor support: GATConv, GatedGraphConv, GCN2Conv, and GENConv聽#6897 )
GENConv (Pytorch Sparse tensor support: GATConv, GatedGraphConv, GCN2Conv, and GENConv聽#6897 )
GeneralConv
GINConv (Add PyTorch SparseTensor support for GINConv, SAGEConv, and GraphConv聽#6532 )
GMMConv (PyTorch Sparse Tensor support: HANConv, GATv2Conv, HGTConv, GMMConv, GPSConv, and RGATConv聽#6932 )
GPSConv (PyTorch Sparse Tensor support: HANConv, GATv2Conv, HGTConv, GMMConv, GPSConv, and RGATConv聽#6932 )
GraphConv (Add PyTorch SparseTensor support for GINConv, SAGEConv, and GraphConv聽#6532 )
GravNetConv
HANConv (PyTorch Sparse Tensor support: HANConv, GATv2Conv, HGTConv, GMMConv, GPSConv, and RGATConv聽#6932 )
HEATConv
HeteroConv
HGTConv (PyTorch Sparse Tensor support: HANConv, GATv2Conv, HGTConv, GMMConv, GPSConv, and RGATConv聽#6932 )
HypergraphConv
LEConv (PyTorch Sparse Tensor support: LEConv, LGConv, NNConv, PANConv, SignedConv, and WLConv聽#6936 )
LGConv (PyTorch Sparse Tensor support: LEConv, LGConv, NNConv, PANConv, SignedConv, and WLConv聽#6936 )
MFConv
NNConv (PyTorch Sparse Tensor support: HANConv, GATv2Conv, HGTConv, GMMConv, GPSConv, and RGATConv聽#6932 )
PANConv (PyTorch Sparse Tensor support: LEConv, LGConv, NNConv, PANConv, SignedConv, and WLConv聽#6936 )
PDNConv
PNAConv
PointNetConv (Pytorch Sparse Tensor support: PointConv, PointGNNConv, PointTransformerConv, PPFConv, and ResGatedGraphConv聽#6937 )
PointGNNConv (Pytorch Sparse Tensor support: PointConv, PointGNNConv, PointTransformerConv, PPFConv, and ResGatedGraphConv聽#6937 )
PointTransformerConv (Pytorch Sparse Tensor support: PointConv, PointGNNConv, PointTransformerConv, PPFConv, and ResGatedGraphConv聽#6937 )
PPFConv (Pytorch Sparse Tensor support: PointConv, PointGNNConv, PointTransformerConv, PPFConv, and ResGatedGraphConv聽#6937 )
ResGatedGraphConv (Pytorch Sparse Tensor support: PointConv, PointGNNConv, PointTransformerConv, PPFConv, and ResGatedGraphConv聽#6937 )
RGATConv (PyTorch Sparse Tensor support: HANConv, GATv2Conv, HGTConv, GMMConv, GPSConv, and RGATConv聽#6932 )
RGCNConv & FastRGCNConv
SAGEConv (Add PyTorch SparseTensor support for GINConv, SAGEConv, and GraphConv聽#6532 , Pytorch Sparse tensor support: ClusterGCN, SAGEConv, AGNNConv, APPNP, and FeaStConv聽#6874 )
SGConv (Add PyTorch SparseTensor support for SGConv, SSGConv and TAGConv聽#6514 )
SignedConv (PyTorch Sparse Tensor support: LEConv, LGConv, NNConv, PANConv, SignedConv, and WLConv聽#6936 )
SplineConv
SSGConv (Add PyTorch SparseTensor support for SGConv, SSGConv and TAGConv聽#6514 )
SuperGATConv
TAGConv (Add PyTorch SparseTensor support for SGConv, SSGConv and TAGConv聽#6514 )
TransformerConv (Pytorch Sparse tensor support: AntiSymmetricConv, CGConv, and TransformerConv聽#6633 )
WLConvContinuous
WLConv (PyTorch Sparse Tensor support: LEConv, LGConv, NNConv, PANConv, SignedConv, and WLConv聽#6936 )
XConv
torch_geometric.transforms.*
馃殌 The feature, motivation and pitch
PyG currently accepts
torch.LongTensor: edge_indexandtorch_sparse.SparseTensor: adjinMessagePassing, which limits its flexibility for users who use native PyTorch SparseTensor. As such, an additional step is required for them to convert one to another.The goal of this roadmap is to track the integration of native PyTorch SparseTensor support into PyG. After integration, the
edge_indexinMessagePassingcan also accept PyTorch SparseTensor while allowing backpropagation liketorch_sparse.SparseTensor.General Roadmap
torch_geometric.nn.MessagePassingand corresponding layers inherited from ittorch_geometric.transformstorch_geometric.loadertorch_sparse.SparseTensorbased implementations with PyTorch functionalityImplementations
Utility functions
is_torch_sparse_tensorfunction. Since bothstrided (dense)orsparse_cootensors are instances oftorch.Tensor, there should be a function to distinguish between two different inputs, i.e., LongTensoredge_indexand SparseTensoradj(Addspmmandis_torch_sparse_tensor聽#5906).spmmfunction: sparse-dense matrix multiplication supporting bothtorch_sparseand PyTorch SparseTensor. For PyTorch SparseTensor, currently onlysumandmeanaggregations are allowed (Addspmmandis_torch_sparse_tensor聽#5906, Addedmeanreduction toutils.spmmfor PyTorch Sparse Tensor聽#6868, PyTorch Sparse Tensor support:HANConv,GATv2Conv,HGTConv,GMMConv,GPSConv, andRGATConv聽#6932).is_sparse_tensor: check for eithertorch.sparse.Tensorortorch_sparse.SparseTensor(Addis_sparseandto_torch_coo_tensor聽#6003).to_torch_coo_tensor: convertedge_indextotorch.sparse.Tensor(coo format) (Addis_sparseandto_torch_coo_tensor聽#6003).torch.sparse.Tensorinput ofadd_self_loop,remove_self_loop, andmaybe_num_nodes(Added PyTorch Sparse Tensor support forremove_self_loops,add_self_loops, andmaybe_num_nodes聽#6847)torch_geometric.nn.*MessagePassing(Add PyTorch SparseTensor support forMessagePassing聽#5944, Pytorch Sparse tensor support:AntiSymmetricConv,CGConv, andTransformerConv聽#6633)GCNConv(Add PyTorch SparseTensor support forGCNConvandgcn_norm聽#6033)AGNNConv(Pytorch Sparse tensor support:ClusterGCN,SAGEConv,AGNNConv,APPNP, andFeaStConv聽#6874)APPNP(Pytorch Sparse tensor support:ClusterGCN,SAGEConv,AGNNConv,APPNP, andFeaStConv聽#6874)AntiSymmetricConv(Pytorch Sparse tensor support:AntiSymmetricConv,CGConv, andTransformerConv聽#6633)ARMAConvCGConv(Pytorch Sparse tensor support:AntiSymmetricConv,CGConv, andTransformerConv聽#6633)ChebConvClusterGCNConv(Pytorch Sparse tensor support:ClusterGCN,SAGEConv,AGNNConv,APPNP, andFeaStConv聽#6874)DNAConv(Pytorch Sparse tensor support:DNAConv,EdgeConv,EGConv, andFAConv聽#6748)EdgeConv(Pytorch Sparse tensor support:DNAConv,EdgeConv,EGConv, andFAConv聽#6748)EGConv(Pytorch Sparse tensor support:DNAConv,EdgeConv,EGConv, andFAConv聽#6748)FAConv(Pytorch Sparse tensor support:DNAConv,EdgeConv,EGConv, andFAConv聽#6748)FeaStConv(Pytorch Sparse tensor support:ClusterGCN,SAGEConv,AGNNConv,APPNP, andFeaStConv聽#6874)FiLMConvFusedGATConvGATConv(Pytorch Sparse tensor support:GATConv,GatedGraphConv,GCN2Conv, andGENConv聽#6897)GatedGraphConv(Pytorch Sparse tensor support:GATConv,GatedGraphConv,GCN2Conv, andGENConv聽#6897)GATv2Conv(PyTorch Sparse Tensor support:HANConv,GATv2Conv,HGTConv,GMMConv,GPSConv, andRGATConv聽#6932)GCN2Conv(Pytorch Sparse tensor support:GATConv,GatedGraphConv,GCN2Conv, andGENConv聽#6897)GENConv(Pytorch Sparse tensor support:GATConv,GatedGraphConv,GCN2Conv, andGENConv聽#6897)GeneralConvGINConv(Add PyTorch SparseTensor support forGINConv,SAGEConv, andGraphConv聽#6532)GMMConv(PyTorch Sparse Tensor support:HANConv,GATv2Conv,HGTConv,GMMConv,GPSConv, andRGATConv聽#6932)GPSConv(PyTorch Sparse Tensor support:HANConv,GATv2Conv,HGTConv,GMMConv,GPSConv, andRGATConv聽#6932)GraphConv(Add PyTorch SparseTensor support forGINConv,SAGEConv, andGraphConv聽#6532)GravNetConvHANConv(PyTorch Sparse Tensor support:HANConv,GATv2Conv,HGTConv,GMMConv,GPSConv, andRGATConv聽#6932)HEATConvHeteroConvHGTConv(PyTorch Sparse Tensor support:HANConv,GATv2Conv,HGTConv,GMMConv,GPSConv, andRGATConv聽#6932)HypergraphConvLEConv(PyTorch Sparse Tensor support:LEConv,LGConv,NNConv,PANConv,SignedConv, andWLConv聽#6936)LGConv(PyTorch Sparse Tensor support:LEConv,LGConv,NNConv,PANConv,SignedConv, andWLConv聽#6936)MFConvNNConv(PyTorch Sparse Tensor support:HANConv,GATv2Conv,HGTConv,GMMConv,GPSConv, andRGATConv聽#6932)PANConv(PyTorch Sparse Tensor support:LEConv,LGConv,NNConv,PANConv,SignedConv, andWLConv聽#6936)PDNConvPNAConvPointNetConv(Pytorch Sparse Tensor support:PointConv,PointGNNConv,PointTransformerConv,PPFConv, andResGatedGraphConv聽#6937)PointGNNConv(Pytorch Sparse Tensor support:PointConv,PointGNNConv,PointTransformerConv,PPFConv, andResGatedGraphConv聽#6937)PointTransformerConv(Pytorch Sparse Tensor support:PointConv,PointGNNConv,PointTransformerConv,PPFConv, andResGatedGraphConv聽#6937)PPFConv(Pytorch Sparse Tensor support:PointConv,PointGNNConv,PointTransformerConv,PPFConv, andResGatedGraphConv聽#6937)ResGatedGraphConv(Pytorch Sparse Tensor support:PointConv,PointGNNConv,PointTransformerConv,PPFConv, andResGatedGraphConv聽#6937)RGATConv(PyTorch Sparse Tensor support:HANConv,GATv2Conv,HGTConv,GMMConv,GPSConv, andRGATConv聽#6932)RGCNConv&FastRGCNConvSAGEConv(Add PyTorch SparseTensor support forGINConv,SAGEConv, andGraphConv聽#6532, Pytorch Sparse tensor support:ClusterGCN,SAGEConv,AGNNConv,APPNP, andFeaStConv聽#6874)SGConv(Add PyTorch SparseTensor support forSGConv,SSGConvandTAGConv聽#6514)SignedConv(PyTorch Sparse Tensor support:LEConv,LGConv,NNConv,PANConv,SignedConv, andWLConv聽#6936)SplineConvSSGConv(Add PyTorch SparseTensor support forSGConv,SSGConvandTAGConv聽#6514)SuperGATConvTAGConv(Add PyTorch SparseTensor support forSGConv,SSGConvandTAGConv聽#6514)TransformerConv(Pytorch Sparse tensor support:AntiSymmetricConv,CGConv, andTransformerConv聽#6633)WLConvContinuousWLConv(PyTorch Sparse Tensor support:LEConv,LGConv,NNConv,PANConv,SignedConv, andWLConv聽#6936)XConvtorch_geometric.transforms.*ToSparseTensor(Added PyTorch Sparse Tensor support forToSparseTensor聽#6930)