def test_output(self, none_fields):
    """Tests that this function produces the identity."""
    graph = self._graph.map(lambda _: None, none_fields)
    with tf.name_scope("test"):
      graph_id = utils_tf.identity(graph)
    graph = utils_tf.make_runnable_in_session(graph)
    graph_id = utils_tf.make_runnable_in_session(graph_id)
    with tf.Session() as sess:
      expected_out, actual_out = sess.run([graph, graph_id])
    for field in [
        "nodes", "edges", "globals", "receivers", "senders", "n_node", "n_edge"
    ]:
      if field in none_fields:
        self.assertEqual(None, getattr(actual_out, field))
      else:
        self.assertNDArrayNear(
            getattr(expected_out, field), getattr(actual_out, field), err=1e-4)
Tests that this function produces the identity.
graph_nets/tests/utils_tf_test.py