code: def max_pool_x(
      cluster: Tensor,
      x: Tensor,
      batch: Tensor,
      batch_size: Optional[int] = None,
      size: Optional[int] = None,
  ) -> Tuple[Tensor, Optional[Tensor]]:
      r"""Max-Pools node features according to the clustering defined in
      :attr:`cluster`.
  
      Args:
          cluster (torch.Tensor): The cluster vector
              :math:`\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
              :math:`\mathbf{b} \in {\{ 0, \ldots, B-1\}}^N`, which assigns each
              node to a specific example.
          batch_size (int, optional): The number of examples :math:`B`.
              Automatically calculated if not given. (default: :obj:`None`)
          size (int, optional): The maximum number of clusters in a single
              example. This property is useful to obtain a batch-wise dense
              representation, *e.g.* for applying FC layers, but should only be
              used if the size of the maximum number of clusters per example is
              known in advance. (default: :obj:`None`)
  
      :rtype: (:class:`torch.Tensor`, :class:`torch.Tensor`) if :attr:`size` is
          :obj:`None`, else :class:`torch.Tensor`
      """
      if size is not None:
          if batch_size is None:
              batch_size = int(batch.max().item()) + 1
          return _max_pool_x(cluster, x, batch_size * size), None
  
      cluster, perm = consecutive_cluster(cluster)
      x = _max_pool_x(cluster, x)
      batch = pool_batch(perm, batch)
  
      return x, batch
  
file_path: pytorch_geometric/torch_geometric/nn/pool/max_pool.py
imports: from typing import Callable, Optional, Tuple
  from torch import Tensor
  from torch_geometric.data import Batch, Data
  from torch_geometric.nn.pool.consecutive import consecutive_cluster
  from torch_geometric.nn.pool.pool import pool_batch, pool_edge, pool_pos
  from torch_geometric.utils import add_self_loops, scatter
label_desc: Use image node_id 2 for calling a global function with example usage: max_pool_x(cluster, x, batch, batch_size, size) and returns: x,  batch, _max_pool_x,  None