torch_geometric.nn.dense.DenseGraphConv
- class DenseGraphConv(in_channels: int, out_channels: int, aggr: str = 'add', bias: bool = True)[source]
Bases:
Module
See
torch_geometric.nn.conv.GraphConv
.- forward(x: Tensor, adj: Tensor, mask: Optional[Tensor] = None) Tensor [source]
Forward pass.
- Parameters:
x (torch.Tensor) – Node feature tensor \(\mathbf{X} \in \mathbb{R}^{B \times N \times F}\), with batch-size \(B\), (maximum) number of nodes \(N\) for each graph, and feature dimension \(F\).
adj (torch.Tensor) – Adjacency tensor \(\mathbf{A} \in \mathbb{R}^{B \times N \times N}\). The adjacency tensor is broadcastable in the batch dimension, resulting in a shared adjacency matrix for the complete batch.
mask (torch.Tensor, optional) – Mask matrix \(\mathbf{M} \in {\{ 0, 1 \}}^{B \times N}\) indicating the valid nodes for each graph. (default:
None
)
- Return type: