class_docstr: DeepSets module.
  
  Implementation for the model described in https://arxiv.org/abs/1703.06114
  (M. Zaheer, S. Kottur, S. Ravanbakhsh, B. Poczos, R. Salakhutdinov, A. Smola).
  See also PointNet (https://arxiv.org/abs/1612.00593, C. Qi, H. Su, K. Mo,
  L. J. Guibas) for a related model.
  
  This module operates on sets, which can be thought of as graphs without
  edges. The nodes features are first updated based on their value and the
  globals features, and new globals features are then computed based on the
  updated nodes features.
  
  Note that in the original model, only the globals are updated in the returned
  graph, while this implementation also returns updated nodes.
  The original model can be reproduced by writing:
  ```
  deep_sets = DeepSets()
  output = deep_sets(input)
  output = input.replace(globals=output.globals)
  ```
  
  This module does not use the edges data or the information contained in the
  receivers or senders; the output graph has the same value in those fields as
  the input graph. Those fields can also have `None` values in the input
  `graphs.GraphsTuple`.
docstr: Initializes the DeepSets module.
  
  Args:
    node_model_fn: A callable to be passed to NodeBlock. The callable must
      return a Sonnet module (or equivalent; see NodeBlock for details). The
      shape of this module's output must equal the shape of the input graph's
      global features, but for the first and last axis.
    global_model_fn: A callable to be passed to GlobalBlock. The callable must
      return a Sonnet module (or equivalent; see GlobalBlock for details).
    reducer: Reduction to be used when aggregating the nodes in the globals.
      This should be a callable whose signature matches
      tf.math.unsorted_segment_sum.
    name: The module name.
code: def __init__(
      self,
      node_model_fn,
      global_model_fn,
      reducer=tf.math.unsorted_segment_sum,
      name="deep_sets",
  ):
      """Initializes the DeepSets module.
  
      Args:
        node_model_fn: A callable to be passed to NodeBlock. The callable must
          return a Sonnet module (or equivalent; see NodeBlock for details). The
          shape of this module's output must equal the shape of the input graph's
          global features, but for the first and last axis.
        global_model_fn: A callable to be passed to GlobalBlock. The callable must
          return a Sonnet module (or equivalent; see GlobalBlock for details).
        reducer: Reduction to be used when aggregating the nodes in the globals.
          This should be a callable whose signature matches
          tf.math.unsorted_segment_sum.
        name: The module name.
      """
      super(DeepSets, self).__init__(name=name)
  
      with self._enter_variable_scope():
          self._node_block = blocks.NodeBlock(
              node_model_fn=node_model_fn,
              use_received_edges=False,
              use_sent_edges=False,
              use_nodes=True,
              use_globals=True,
          )
          self._global_block = blocks.GlobalBlock(
              global_model_fn=global_model_fn,
              use_edges=False,
              use_nodes=True,
              use_globals=False,
              nodes_reducer=reducer,
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from graph_nets import _base
  from graph_nets import blocks
  import tensorflow
label_desc: Use image node_id 1 to create a new DeepSets object from inherited base classes: _base with example: obj = DeepSets(node_model_fn, global_model_fn, reducer, name)