class_docstr: A linear attention form, inspired by BiDAF:
  a = W (u; v; u o v)
class_docstr_tok: ["A","linear","attention","form",",","inspired","by","BiDAF",":","a","=","W","(","u",";","v",";","u","o","v",")"]
code: def __init__(self, dim):
      super(LinearAttention, self).__init__()
      self.linear = nn.Linear(dim * 3, 1, bias=False)
      self.linear_out = nn.Linear(dim * 2, dim, bias=False)
      self.sm = nn.Softmax(dim=1)
      self.tanh = nn.Tanh()
      self.mask = None
  
imports: import logging
  import torch
  import torch.nn
  import math
  import numpy
  import stanza.models.common.seq2seq_constant
label_desc: Use image node_id 1 to create a new LinearAttention object from inherited base classes: nn with example: obj = LinearAttention(dim)