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`)
code: def __check_input__(self, edge_index, size):
      the_size: List[Optional[int]] = [None, None]
  
      if isinstance(edge_index, Tensor):
          assert edge_index.dtype == torch.long
          assert edge_index.dim() == 2
          assert edge_index.size(0) == 2
          if size is not None:
              the_size[0] = size[0]
              the_size[1] = size[1]
          return the_size
  
      elif isinstance(edge_index, SparseTensor):
          if self.flow == "target_to_source":
              raise ValueError(
                  (
                      'Flow direction "target_to_source" is invalid for '
                      "message propagation via `torch_sparse.SparseTensor`. If "
                      "you really want to make use of a reverse message "
                      "passing flow, pass in the transposed sparse tensor to "
                      "the message passing module, e.g., `adj_t.t()`."
                  )
              )
          the_size[0] = edge_index.sparse_size(1)
          the_size[1] = edge_index.sparse_size(0)
          return the_size
  
      raise ValueError(
          (
              "`MessagePassing.propagate` only supports `torch.LongTensor` of "
              "shape `[2, num_messages]` or `torch_sparse.SparseTensor` for "
              "argument `edge_index`."
          )
      )
  
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 2 for calling the MessagePassing obj's underlying member method code with example usage: obj.__check_input__(edge_index, size) and returns: the_size, the_size