class_docstr: Soft alignment attention implement.
  
  Attributes:
      dim (int): attention hidden dim
docstr: Core implemention of soft attention
  
  Args:
      inputs (object): input tensor.
  
  Returns:
      object: weighted sum of input tensors.
docstr_tok: ["Core","implemention","of","soft","attention","Args",":","inputs","(","object",")",":","input","tensor",".","Returns",":","object",":","weighted","sum","of","input","tensors","."]
code: def call(self, inputs, mask=None, **kwargs):
      """Core implemention of soft attention
  
      Args:
          inputs (object): input tensor.
  
      Returns:
          object: weighted sum of input tensors.
      """
  
      attention = K.tanh(K.dot(inputs, self.W) + self.b)
      attention = K.dot(attention, self.q)
  
      attention = K.squeeze(attention, axis=2)
  
      if mask is None:
          attention = K.exp(attention)
      else:
          attention = K.exp(attention) * K.cast(mask, dtype="float32")
  
      attention_weight = attention / (
          K.sum(attention, axis=-1, keepdims=True) + K.epsilon()
      )
  
      attention_weight = K.expand_dims(attention_weight)
      weighted_input = inputs * attention_weight
      return K.sum(weighted_input, axis=1)
  
imports: import tensorflow.compat.v1.keras
  from tensorflow.compat.v1.linalg import einsum
  from tensorflow.compat.v1.keras import layers
  from tensorflow.compat.v1.keras import backend
label_desc: Use image node_id 3 for calling the AttLayer2 obj's underlying member method code with example usage: obj.call(inputs, mask) and returns: K