class_docstr: Aggregation layer for message passing withing GNN.
  
  :param aggregate: The aggregation function to use (max, mean, sum).
  :param pooling_mask: Multiplicative pooling mask for efficient aggregation computation.
docstr: :param aggregate: The aggregation function string.
  :return: The actual torch aggregation function.
docstr_tok: [":","param","aggregate",":","The","aggregation","function","string",".",":","return",":","The","actual","torch","aggregation","function","."]
code: def _aggregation_fun(cls, aggregate: str) -> Any:
      """
      :param aggregate: The aggregation function string.
      :return: The actual torch aggregation function.
      """
      if aggregate == "max":
  
          def maximum(a, dim):
              return torch.max(a, dim=dim)[0]
  
          return maximum
      elif aggregate == "mean":
          return torch.nanmean
      elif aggregate == "sum":
          return torch.nansum
      else:
          raise ValueError
  
imports: from typing import Any, List, Tuple, Union, Sequence, Dict
  import numpy
  import torch
  from torch import nn
  from torch_scatter import scatter
  from maze.core.annotations import override
  from maze.core.utils.factory import Factory
  from maze.perception.blocks.shape_normalization import ShapeNormalizationBlock
label_desc: Use image node_id 4 for calling the AggregationLayer obj's underlying member method code with example usage: obj._aggregation_fun(cls, aggregate) and returns: maximum, torch, torch, torch