code: def set_zero_global_features(
      graph,
      global_size,
      dtype=tf.float32,
      name="set_zero_global_features",
  ):
      """Completes the global state of a graph.
  
      Args:
        graph: A `graphs.GraphsTuple` with a `None` global state.
        global_size: (int) the dimension for the created global features.
        dtype: (tensorflow type) the type for the created global features.
        name: (string, optional) A name for the operation.
  
      Returns:
        The same graph but for the global field, which is a `Tensor` of shape
        `[num_graphs, global_size]`, type `dtype` and filled with zeros.
  
      Raises:
        ValueError: If the `GLOBALS` field of `graph` is not `None`.
        ValueError: If `global_size` is not `None`.
      """
      if graph.globals is not None:
          raise ValueError(
              "Cannot complete global state if graph already has global features."
          )
      if global_size is None:
          raise ValueError(
              "Cannot complete globals with None global_size"
          )
      with tf.name_scope(name):
          n_graphs = get_num_graphs(graph)
          return graph._replace(
              globals=tf.zeros(
                  shape=[n_graphs, global_size], dtype=dtype
              )
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import functools
  from absl import logging
  from graph_nets import graphs
  from graph_nets import utils_np
  import six
  from six.moves import range
  import tensorflow
  import tree
label_desc: Use image node_id 24 for calling a global function with example usage: set_zero_global_features(graph, global_size, dtype, name) and returns: graph