class_docstr: Graph attention block.
docstr: Initializes a GAT block.
  
  Args:
    hidden_dim: (int) Dimension of hidden layer.
    dropout_rate: (float) Dropout probability
    num_heads: (int) Number of attention heads.
    sparse: (bool) Whether features are sparse
    **kwargs: Keyword arguments for tf.keras.layers.Layer.
docstr_tok: ["Initializes","a","GAT","block",".","Args",":","hidden_dim",":","(","int",")","Dimension","of","hidden","layer",".","dropout_rate",":","(","float",")","Dropout","probability","num_heads",":","(","int",")","Number","of","attention","heads",".","sparse",":","(","bool",")","Whether","features","are","sparse","*","*","kwargs",":","Keyword","arguments","for","tf.keras.layers.Layer","."]
code: def __init__(
      self, hidden_dim, dropout_rate, num_heads, sparse, **kwargs
  ):
      """Initializes a GAT block.
  
      Args:
        hidden_dim: (int) Dimension of hidden layer.
        dropout_rate: (float) Dropout probability
        num_heads: (int) Number of attention heads.
        sparse: (bool) Whether features are sparse
        **kwargs: Keyword arguments for tf.keras.layers.Layer.
      """
      super(GATBlock, self).__init__(**kwargs)
      self.hidden_dim = hidden_dim
      self.dropout_rate = dropout_rate
      self.num_heads = num_heads
  
      self._activation = tf.keras.layers.ELU()
      self._dropout = tf.keras.layers.Dropout(self.dropout_rate)
  
      if sparse:
          self._graph_attn_layer = [
              SparseGraphAttnLayer(self.hidden_dim, self.dropout_rate)
              for _ in range(self.num_heads)
          ]
      else:
          self._graph_attn_layer = [
              GraphAttnLayer(self.hidden_dim, self.dropout_rate)
              for _ in range(self.num_heads)
          ]
  
imports: from layers import GraphAttnLayer
  from layers import GraphConvLayer
  from layers import GraphIsomorphismLayer
  from layers import SparseGraphAttnLayer
  import tensorflow
label_desc: Use image node_id 1 to create a new GATBlock object from inherited base classes: tf.keras.layers with example: obj = GATBlock(hidden_dim, dropout_rate, num_heads, sparse)