code: def invoke_gsddmm(graph, func):
      """Invoke g-SDDMM computation on the graph.
  
      Parameters
      ----------
      graph :  DGLGraph
          The input graph.
      func : dgl.function.BaseMessageFunction
          Built-in message function.
  
      Returns
      -------
      dict[str, Tensor]
          Results from the g-SDDMM computation.
      """
      alldata = [graph.srcdata, graph.dstdata, graph.edata]
      if isinstance(func, fn.BinaryMessageFunction):
          x = alldata[func.lhs][func.lhs_field]
          y = alldata[func.rhs][func.rhs_field]
          op = getattr(ops, func.name)
          if graph._graph.number_of_etypes() > 1:
              lhs_target, _, rhs_target = func.name.split("_", 2)
              x = data_dict_to_list(graph, x, func, lhs_target)
              y = data_dict_to_list(graph, y, func, rhs_target)
          z = op(graph, x, y)
      else:
          x = alldata[func.target][func.in_field]
          op = getattr(ops, func.name)
          if graph._graph.number_of_etypes() > 1:
              # Convert to list as dict is unordered.
              if func.name == "copy_u":
                  x = data_dict_to_list(graph, x, func, "u")
              else:  # "copy_e"
                  x = data_dict_to_list(graph, x, func, "e")
          z = op(graph, x)
      return {func.out_field: z}
  
file_path: dgl/python/dgl/core.py
imports: import numpy
  from .None import backend, function, ops
  from .base import ALL, dgl_warning, DGLError, EID, is_all, NID
  from .frame import Frame
  from .udf import EdgeBatch, NodeBatch
label_desc: Use image node_id 7 for calling a global function with example usage: invoke_gsddmm(graph, func) and returns: dict