class_docstr: Base class for creating message passing layers of the form
  
  .. math::
      \mathbf{x}_i^{\prime} = \gamma_{\mathbf{\Theta}} \left( \mathbf{x}_i,
      \square_{j \in \mathcal{N}(i)} \, \phi_{\mathbf{\Theta}}
      \left(\mathbf{x}_i, \mathbf{x}_j,\mathbf{e}_{j,i}\right) \right),
  
  where :math:`\square` denotes a differentiable, permutation invariant
  function, *e.g.*, sum, mean or max, and :math:`\gamma_{\mathbf{\Theta}}`
  and :math:`\phi_{\mathbf{\Theta}}` denote differentiable functions such as
  MLPs.
  See `here <https://pytorch-geometric.readthedocs.io/en/latest/notes/
  create_gnn.html>`__ for the accompanying tutorial.
  
  Args:
      aggr (string, optional): The aggregation scheme to use
          (:obj:`"add"`, :obj:`"mean"`, :obj:`"max"` or :obj:`None`).
          (default: :obj:`"add"`)
      flow (string, optional): The flow direction of message passing
          (:obj:`"source_to_target"` or :obj:`"target_to_source"`).
          (default: :obj:`"source_to_target"`)
      node_dim (int, optional): The axis along which to propagate.
          (default: :obj:`-2`)
docstr: Aggregates messages from neighbors as
  :math:`\square_{j \in \mathcal{N}(i)}`.
  
  Takes in the output of message computation as first argument and any
  argument which was initially passed to :meth:`propagate`.
  
  By default, this function will delegate its call to scatter functions
  that support "add", "mean" and "max" operations as specified in
  :meth:`__init__` by the :obj:`aggr` argument.
docstr_tok: ["Aggregates","messages","from","neighbors","as",":","math",":","`","\\square_","{","j","\\in","\\mathcal","{","N","}","(","i",")","}","`",".","Takes","in","the","output","of","message","computation","as","first","argument","and","any","argument","which","was","initially","passed","to",":","meth",":","`","propagate","`",".","By","default",",","this","function","will","delegate","its","call","to","scatter","functions","that","support","``","add","''",",","``","mean","''","and","``","max","''","operations","as","specified","in",":","meth",":","`","__init__","`","by","the",":","obj",":","`","aggr","`","argument","."]
code: def aggregate(
      self,
      inputs: Tensor,
      index: Tensor,
      ptr: Optional[Tensor] = None,
      dim_size: Optional[int] = None,
  ) -> Tensor:
      r"""Aggregates messages from neighbors as
      :math:`\square_{j \in \mathcal{N}(i)}`.
  
      Takes in the output of message computation as first argument and any
      argument which was initially passed to :meth:`propagate`.
  
      By default, this function will delegate its call to scatter functions
      that support "add", "mean" and "max" operations as specified in
      :meth:`__init__` by the :obj:`aggr` argument.
      """
      if ptr is not None:
          ptr = expand_left(ptr, dim=self.node_dim, dims=inputs.dim())
          return segment_csr(inputs, ptr, reduce=self.aggr)
      else:
          return scatter(
              inputs,
              index,
              dim=self.node_dim,
              dim_size=dim_size,
              reduce=self.aggr,
          )
  
imports: import os
  import re
  import inspect
  import os.path
  from uuid import uuid1
  from itertools import chain
  from inspect import Parameter
  from typing import List, Optional, Set
  from torch_geometric.typing import Adj, Size
  import torch
  from torch import Tensor
  from jinja2 import Template
  from torch_sparse import SparseTensor
  from torch_scatter import gather_csr, scatter, segment_csr
  from .utils.helpers import expand_left
  from .utils.jit import class_from_module_repr
  from .utils.typing import sanitize, split_types_repr, parse_types, resolve_types
  from .utils.inspector import Inspector, func_header_repr, func_body_repr
label_desc: Use image node_id 8 for calling the MessagePassing obj's underlying member method code with example usage: obj.aggregate(inputs, index, ptr, dim_size) and returns: segment_csr, scatter