class_docstr: The graph attentional operator from the `"Graph Attention Networks"
  <https://arxiv.org/abs/1710.10903>`_ paper
  
  .. math::
      \mathbf{x}^{\prime}_i = \alpha_{i,i}\mathbf{\Theta}\mathbf{x}_{i} +
      \sum_{j \in \mathcal{N}(i)} \alpha_{i,j}\mathbf{\Theta}\mathbf{x}_{j},
  
  where the attention coefficients :math:`\alpha_{i,j}` are computed as
  
  .. math::
      \alpha_{i,j} =
      \frac{
      \exp\left(\mathrm{LeakyReLU}\left(\mathbf{a}^{\top}
      [\mathbf{\Theta}\mathbf{x}_i \, \Vert \, \mathbf{\Theta}\mathbf{x}_j]
      \right)\right)}
      {\sum_{k \in \mathcal{N}(i) \cup \{ i \}}
      \exp\left(\mathrm{LeakyReLU}\left(\mathbf{a}^{\top}
      [\mathbf{\Theta}\mathbf{x}_i \, \Vert \, \mathbf{\Theta}\mathbf{x}_k]
      \right)\right)}.
  
  Args:
      in_channels (int or tuple): Size of each input sample. A tuple
          corresponds to the sizes of source and target dimensionalities.
      out_channels (int): Size of each output sample.
      heads (int, optional): Number of multi-head-attentions.
          (default: :obj:`1`)
      concat (bool, optional): If set to :obj:`False`, the multi-head
          attentions are averaged instead of concatenated.
          (default: :obj:`True`)
      negative_slope (float, optional): LeakyReLU angle of the negative
          slope. (default: :obj:`0.2`)
      dropout (float, optional): Dropout probability of the normalized
          attention coefficients which exposes each node to a stochastically
          sampled neighborhood during training. (default: :obj:`0`)
      add_self_loops (bool, optional): If set to :obj:`False`, will not add
          self-loops to the input graph. (default: :obj:`True`)
      bias (bool, optional): If set to :obj:`False`, the layer will not learn
          an additive bias. (default: :obj:`True`)
      **kwargs (optional): Additional arguments of
          :class:`torch_geometric.nn.conv.MessagePassing`.
class_docstr_tok: ["The","graph","attentional","operator","from","the","`","``","Graph","Attention","Networks","''","<","https",":","\/\/arxiv.org\/abs\/1710.10903",">","`","_","paper","..","math",":",":","\\mathbf","{","x","}","^","{","\\prime","}","_i","=","\\alpha_","{","i",",","i","}","\\mathbf","{","\\Theta","}","\\mathbf","{","x","}","_","{","i","}","+","\\sum_","{","j","\\in","\\mathcal","{","N","}","(","i",")","}","\\alpha_","{","i",",","j","}","\\mathbf","{","\\Theta","}","\\mathbf","{","x","}","_","{","j","}",",","where","the","attention","coefficients",":","math",":","`","\\alpha_","{","i",",","j","}","`","are","computed","as","..","math",":",":","\\alpha_","{","i",",","j","}","=","\\frac","{","\\exp\\left","(","\\mathrm","{","LeakyReLU","}","\\left","(","\\mathbf","{","a","}","^","{","\\top","}","[","\\mathbf","{","\\Theta","}","\\mathbf","{","x","}","_i","\\",",","\\Vert","\\",",","\\mathbf","{","\\Theta","}","\\mathbf","{","x","}","_j","]","\\right",")","\\right",")","}","{","\\sum_","{","k","\\in","\\mathcal","{","N","}","(","i",")","\\cup","\\","{","i","\\","}","}","\\exp\\left","(","\\mathrm","{","LeakyReLU","}","\\left","(","\\mathbf","{","a","}","^","{","\\top","}","[","\\mathbf","{","\\Theta","}","\\mathbf","{","x","}","_i","\\",",","\\Vert","\\",",","\\mathbf","{","\\Theta","}","\\mathbf","{","x","}","_k","]","\\right",")","\\right",")","}",".","Args",":","in_channels","(","int","or","tuple",")",":","Size","of","each","input","sample",".","A","tuple","corresponds","to","the","sizes","of","source","and","target","dimensionalities",".","out_channels","(","int",")",":","Size","of","each","output","sample",".","heads","(","int",",","optional",")",":","Number","of","multi-head-attentions",".","(","default",":",":","obj",":","`","1","`",")","concat","(","bool",",","optional",")",":","If","set","to",":","obj",":","`","False","`",",","the","multi-head","attentions","are","averaged","instead","of","concatenated",".","(","default",":",":","obj",":","`","True","`",")","negative_slope","(","float",",","optional",")",":","LeakyReLU","angle","of","the","negative","slope",".","(","default",":",":","obj",":","`","0.2","`",")","dropout","(","float",",","optional",")",":","Dropout","probability","of","the","normalized","attention","coefficients","which","exposes","each","node","to","a","stochastically","sampled","neighborhood","during","training",".","(","default",":",":","obj",":","`","0","`",")","add_self_loops","(","bool",",","optional",")",":","If","set","to",":","obj",":","`","False","`",",","will","not","add","self-loops","to","the","input","graph",".","(","default",":",":","obj",":","`","True","`",")","bias","(","bool",",","optional",")",":","If","set","to",":","obj",":","`","False","`",",","the","layer","will","not","learn","an","additive","bias",".","(","default",":",":","obj",":","`","True","`",")","*","*","kwargs","(","optional",")",":","Additional","arguments","of",":","class",":","`","torch_geometric.nn.conv.MessagePassing","`","."]
code: def __init__(
      self,
      in_channels: Union[int, Tuple[int, int]],
      out_channels: int,
      heads: int = 1,
      concat: bool = True,
      negative_slope: float = 0.2,
      dropout: float = 0.0,
      add_self_loops: bool = True,
      bias: bool = True,
      **kwargs,
  ):
      kwargs.setdefault("aggr", "add")
      super(GATConv, self).__init__(node_dim=0, **kwargs)
  
      self.in_channels = in_channels
      self.out_channels = out_channels
      self.heads = heads
      self.concat = concat
      self.negative_slope = negative_slope
      self.dropout = dropout
      self.add_self_loops = add_self_loops
  
      if isinstance(in_channels, int):
          self.lin_l = Linear(
              in_channels, heads * out_channels, bias=False
          )
          self.lin_r = self.lin_l
      else:
          self.lin_l = Linear(
              in_channels[0], heads * out_channels, False
          )
          self.lin_r = Linear(
              in_channels[1], heads * out_channels, False
          )
  
      self.att_l = Parameter(torch.Tensor(1, heads, out_channels))
      self.att_r = Parameter(torch.Tensor(1, heads, out_channels))
  
      if bias and concat:
          self.bias = Parameter(torch.Tensor(heads * out_channels))
      elif bias and not concat:
          self.bias = Parameter(torch.Tensor(out_channels))
      else:
          self.register_parameter("bias", None)
  
      self._alpha = None
  
      self.reset_parameters()
  
file_path: AutoGL/autogl/module/nas/space/gasso_space/gat_conv.py
imports: from typing import Union, Tuple, Optional
  from torch_geometric.typing import OptPairTensor, Adj, Size, NoneType, OptTensor
  import torch
  from torch import Tensor
  import torch.nn.functional
  from torch.nn import Parameter, Linear
  from torch_sparse import SparseTensor, set_diag
  from torch_geometric.nn.conv import MessagePassing
  from torch_geometric.utils import remove_self_loops, add_self_loops, softmax
  from .inits import glorot, zeros
label_desc: Use image node_id 1 to create a new GATConv object from inherited base classes: MessagePassing with example: obj = GATConv(in_channels, out_channels, heads, concat, negative_slope, dropout, add__loops, bias)