src/graphnet/components/pool.py
def sum_pool_and_distribute(
    tensor: Tensor,
    cluster_index: LongTensor,
    batch: Optional[LongTensor] = None,
) -> Tensor:
    """Sum-pool values across the cluster, and distribute the individual nodes."""
    if batch is None:
        batch = torch.zeros(tensor.size(dim=0)).long()
    tensor_pooled, _ = sum_pool_x(cluster_index, tensor, batch)
    inv, _ = consecutive_cluster(cluster_index)
    tensor_unpooled = tensor_pooled[inv]
    return tensor_unpooled
Sum-pool values across the cluster, and distribute the individual nodes.
Sum-pool values across the cluster, and distribute the individual nodes.
Sum - pool values across the cluster and distribute the individual nodes .
def sum_pool_and_distribute(
    tensor: Tensor,
    cluster_index: LongTensor,
    batch: Optional[LongTensor] = None,
) -> Tensor:
    if batch is None:
        batch = torch.zeros(tensor.size(dim=0)).long()
    tensor_pooled, _ = sum_pool_x(cluster_index, tensor, batch)
    inv, _ = consecutive_cluster(cluster_index)
    tensor_unpooled = tensor_pooled[inv]
    return tensor_unpooled
def sum_pool_and_distribute ( tensor : Tensor , cluster_index : LongTensor , batch : Optional [ LongTensor ] = None , ) -> Tensor : if batch is None : batch = torch . zeros ( tensor . size ( dim = 0 ) ) . long ( ) tensor_pooled , _ = sum_pool_x ( cluster_index , tensor , batch ) inv , _ = consecutive_cluster ( cluster_index ) tensor_unpooled = tensor_pooled [ inv ] return tensor_unpooled
Sum-pool values across the cluster, and distribute the individual nodes.
Sum - pool values across the cluster and distribute the individual nodes .
"""Sum-pool values across the cluster, and distribute the individual nodes."""
tensor
Tensor
cluster_index
LongTensor
batch
Optional[LongTensor]