docstr: Tests that the mapping function is called exactly once per field.
docstr_tok: ["Tests","that","the","mapping","function","is","called","exactly","once","per","field","."]
code: def test_map_field_called_only_once(self):
      """Tests that the mapping function is called exactly once per field."""
      graph = graphs.GraphsTuple(**self.graph)
      mapped_fields = []
  
      def map_fn(v):
          mapped_fields.append(v)
          return v
  
      graph = graph.map(map_fn, graphs.ALL_FIELDS)
      self.assertCountEqual(mapped_fields, graphs.ALL_FIELDS)
  
file_path: graph_nets/graph_nets/tests/graphs_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  from graph_nets import graphs
  import tensorflow
label_desc: Use image node_id 7 for calling the GraphsTest obj's underlying member method code with example usage: obj.test_map_field_called_only_once() and returns: v