torch_geometric.nn.pool.avg_pool_x
- avg_pool_x(cluster: Tensor, x: Tensor, batch: Tensor, batch_size: Optional[int] = None, size: Optional[int] = None) Tuple[Tensor, Optional[Tensor]][source]
根据
cluster中定义的聚类,平均池化节点特征。 有关更多详细信息,请参见torch_geometric.nn.pool.max_pool_x()。- Parameters:
cluster (torch.Tensor) – The cluster vector \(\mathbf{c} \in \{ 0, \ldots, N - 1 \}^N\), which assigns each node to a specific cluster.
x (Tensor) – The node feature matrix.
batch (torch.Tensor) – The batch vector \(\mathbf{b} \in {\{ 0, \ldots, B-1\}}^N\), which assigns each node to a specific example.
batch_size (int, optional) – The number of examples \(B\). Automatically calculated if not given. (default:
None)
- Return type:
(
torch.Tensor,torch.Tensor) ifsizeisNone, elsetorch.Tensor