class_docstr: The linear scaled attention mechanism from the
  `"Rethinking Attention with Performers"
  <https://arxiv.org/abs/2009.14794>`_ paper.
  
  Args:
      channels (int): Size of each input sample.
      heads (int, optional): Number of parallel attention heads.
      head_channels (int, optional): Size of each attention head.
          (default: :obj:`64.`)
      kernel (Callable, optional): Kernels for generalized attention.
          If not specified, `ReLU` kernel will be used.
          (default: :obj:`torch.nn.ReLU()`)
      qkv_bias (bool, optional): If specified, add bias to query, key
          and value in the self attention. (default: :obj:`False`)
      attn_out_bias (bool, optional): If specified, add bias to the
          attention output. (default: :obj:`True`)
      dropout (float, optional): Dropout probability of the final
          attention output. (default: :obj:`0.0`)
class_docstr_tok: ["The","linear","scaled","attention","mechanism","from","the","`","``","Rethinking","Attention","with","Performers","''","<","https",":","\/\/arxiv.org\/abs\/2009.14794",">","`","_","paper",".","Args",":","channels","(","int",")",":","Size","of","each","input","sample",".","heads","(","int",",","optional",")",":","Number","of","parallel","attention","heads",".","head_channels","(","int",",","optional",")",":","Size","of","each","attention","head",".","(","default",":",":","obj",":","`","64.","`",")","kernel","(","Callable",",","optional",")",":","Kernels","for","generalized","attention",".","If","not","specified",",","`","ReLU","`","kernel","will","be","used",".","(","default",":",":","obj",":","`","torch.nn.ReLU","(",")","`",")","qkv_bias","(","bool",",","optional",")",":","If","specified",",","add","bias","to","query",",","key","and","value","in","the","self","attention",".","(","default",":",":","obj",":","`","False","`",")","attn_out_bias","(","bool",",","optional",")",":","If","specified",",","add","bias","to","the","attention","output",".","(","default",":",":","obj",":","`","True","`",")","dropout","(","float",",","optional",")",":","Dropout","probability","of","the","final","attention","output",".","(","default",":",":","obj",":","`","0.0","`",")"]
code: def __init__(
      self,
      channels: int,
      heads: int,
      head_channels: int = 64,
      kernel: Callable = torch.nn.ReLU(),
      qkv_bias: bool = False,
      attn_out_bias: bool = True,
      dropout: float = 0.0,
  ):
      super().__init__()
      assert channels % heads == 0
      if head_channels is None:
          head_channels = channels // heads
  
      self.heads = heads
      self.head_channels = head_channels
      self.kernel = kernel
      self.fast_attn = PerformerProjection(head_channels, kernel)
  
      inner_channels = head_channels * heads
      self.q = torch.nn.Linear(channels, inner_channels, bias=qkv_bias)
      self.k = torch.nn.Linear(channels, inner_channels, bias=qkv_bias)
      self.v = torch.nn.Linear(channels, inner_channels, bias=qkv_bias)
      self.attn_out = torch.nn.Linear(
          inner_channels, channels, bias=attn_out_bias
      )
      self.dropout = torch.nn.Dropout(dropout)
  
file_path: pytorch_geometric/torch_geometric/nn/attention/performer.py
imports: import math
  from typing import Callable, Optional
  import torch
  from torch import Tensor
label_desc: Use image node_id 1 to create a new PerformerAttention object from inherited base classes: torch.nn with example: obj = PerformerAttention(channels, heads, head_channels, kernel, qkv_bias, attn_out_bias, dropout)