code: def primitive_zero(sess, node, output_dim, group_size, rank):
      if not is_partition(output_dim):
          return
      source_dims, num_partitions = node.parser.emit_dims_by_id(
          output_dim
      )
      if num_partitions == 0:
          return
      has_params, connectors = False, {}
      for inp in source_dims:
          if not is_replicas(source_dims[inp]):
              continue
          if node.inputs[inp].op_type == "param":
              source_dims[inp] = -2
              has_params, connectors[inp] = True, sess.backend.link(
                  "$", -2, -1, output_shape=node.inputs[inp].shape
              )
          else:
              connectors[inp] = sess.backend.link(
                  "$",
                  -1,
                  None,
                  is_param=(node.inputs[inp].op_type == "param"),
              )
      if not has_params:
          return
      yield (0, source_dims, connectors)
  
file_path: tutel/tutel/parted/patterns.py
imports: from .solver import register_primitive
label_desc: Use image node_id 9 for calling a global function with example usage: primitive_zero(sess, node, output_dim, group_size, rank) without return types