code: def _gen_spmm_func(binary_op, reduce_op):
      name = "u_{}_e_{}".format(binary_op, reduce_op)
      docstring = """Generalized SpMM function.
      It fuses two steps into one kernel.
  
      1. Computes messages by {} source node and edge features.
      2. Aggregate the messages by {} as the features on destination nodes.
  
      Parameters
      ----------
      g : DGLGraph
          The input graph
      x : tensor
          The source node features.
      y : tensor
          The edge features.
  
      Returns
      -------
      tensor
          The result tensor.
  
      Notes
      -----
      This function supports autograd (computing input gradients given the output gradient). If the
      feature shape of two input operands do not match, we first broadcasts the features to a unified
      shape (note that the memory usage will not increase accordingly) and then performs the operation.
  
      Broadcasting follows NumPy semantics. Please see
      https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html
      for more details about the NumPy broadcasting semantics.
      """.format(
          binary_op, reduce_op
      )
      docstring = _attach_zerodeg_note(docstring, reduce_op)
  
      def func(g, x, y):
          return gspmm(g, binary_op, reduce_op, x, y)
  
      func.__name__ = name
      func.__doc__ = docstring
      return func
  
file_path: dgl/python/dgl/ops/spmm.py
imports: import sys
  from ..None import backend
  from ..backend import gspmm, gspmm_hetero
label_desc: Use image node_id 4 for calling a global function with example usage: _gen_spmm_func(binary_op, reduce_op) and returns: func, gspmm