class_docstr: Tests of GraphAttention layer
class_docstr_tok: ["Tests","of","GraphAttention","layer"]
code: def test_apply_average_with_neighbours(self):
      gat_saliency = self.layer(
          units=self.F_out,
          attn_heads=self.attn_heads,
          attn_heads_reduction="average",
          activation=self.activation,
          kernel_initializer="ones",
          attn_kernel_initializer="zeros",
          bias_initializer="zeros",
          saliency_map_support=True,
      )
  
      gat_origin = self.layer(
          units=self.F_out,
          attn_heads=self.attn_heads,
          attn_heads_reduction="average",
          activation=self.activation,
          kernel_initializer="ones",
          attn_kernel_initializer="zeros",
          bias_initializer="zeros",
          saliency_map_support=False,
      )
  
      x_inp, layer_inp = self.get_inputs()
  
      # Instantiate layer with squeezed matrix
      x_out_saliency = gat_saliency(layer_inp)
      x_out_origin = gat_origin(layer_inp)
  
      model_origin = keras.Model(inputs=x_inp, outputs=x_out_origin)
      model_saliency = keras.Model(inputs=x_inp, outputs=x_out_saliency)
      assert model_origin.output_shape[-1] == self.F_out
      assert model_saliency.output_shape[-1] == self.F_out
  
      X = np.zeros((1, self.N, self.F_in))  # features
      for i in range(self.N):
          X[:, i, :] = i
  
      As = self.get_matrix([((0, 1), 1), ((1, 0), 1)])
  
      expected = (X * self.F_in)[..., : self.F_out]
      expected[:, :2] = self.F_in / 2
      actual_origin = model_origin.predict([X] + As)
      actual_saliency = model_saliency.predict([X] + As)
      np.testing.assert_allclose(expected, actual_origin)
      np.testing.assert_allclose(expected, actual_saliency)
  
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 6 for calling the Test_GraphAttention obj's underlying member method code with example usage: obj.test_apply_average_with_neighbours() without return types