code: def __init__(self, config: Config, n_input: int) -> None:
      super().__init__(config)
  
      self.dropout = nn.Dropout(config.dropout)
      self.n_input = n_input
      self.n_attn = config.attn_dimension
      self.ws1 = nn.Linear(n_input, self.n_attn, bias=False)
      self.ws2 = nn.Linear(self.n_attn, 1, bias=False)
      self.tanh = nn.Tanh()
      self.softmax = nn.Softmax()
      self.init_weights()
      log_class_usage(__class__)
  
imports: import torch
  import torch.nn
  import torch.onnx.operators
  from pytext.config import ConfigBase
  from pytext.models.module import Module
  from pytext.utils.usage import log_class_usage
label_desc: Use image node_id 1 to create a new SelfAttention object from inherited base classes: Module with example: obj = SelfAttention(config, n_input)