class_docstr: Tests of GAT class
class_docstr_tok: ["Tests","of","GAT","class"]
code: def test_gat_serialize(self):
      G = example_graph(feature_size=self.F_in)
      gen = FullBatchNodeGenerator(
          G, sparse=self.sparse, method=self.method
      )
      gat = GAT(
          layer_sizes=self.layer_sizes,
          activations=self.activations,
          attn_heads=self.attn_heads,
          generator=gen,
          bias=True,
          normalize="l2",
      )
  
      x_in, x_out = gat.in_out_tensors()
      model = keras.Model(inputs=x_in, outputs=x_out)
  
      ng = gen.flow(G.nodes())
  
      # Save model
      model_json = model.to_json()
  
      # Set all weights to one
      model_weights = [np.ones_like(w) for w in model.get_weights()]
  
      # Load model from json & set all weights
      model2 = keras.models.model_from_json(
          model_json,
          custom_objects={
              "GraphAttention": GraphAttention,
              "GatherIndices": GatherIndices,
          },
      )
      model2.set_weights(model_weights)
  
      # Test deserialized model
      actual = model2.predict(ng)
      expected = np.ones(
          (G.number_of_nodes(), self.layer_sizes[-1])
      ) * (1.0 / G.number_of_nodes())
      np.testing.assert_allclose(expected, actual[0])
  
imports: import pytest
  import scipy.sparse
  import tensorflow
  from tensorflow import keras
  from tensorflow.keras import backend
  from tensorflow.keras.layers import Input
  from stellargraph.mapper import FullBatchNodeGenerator, FullBatchLinkGenerator, GraphSAGENodeGenerator
  from stellargraph.layer import *
  from ..test_utils.graphs import example_graph
  from ..None import test_utils
label_desc: Use image node_id 9 for calling the Test_GAT obj's underlying member method code with example usage: obj.test_gat_serialize() without return types