class_docstr: Soft alignment attention implement.
  
  Attributes:
      dim (int): attention hidden dim
docstr: Initialization for variables in AttLayer2
  There are there variables in AttLayer2, i.e. W, b and q.
  
  Args:
      input_shape (object): shape of input tensor.
docstr_tok: ["Initialization","for","variables","in","AttLayer2","There","are","there","variables","in","AttLayer2",",","i.e",".","W",",","b","and","q.","Args",":","input_shape","(","object",")",":","shape","of","input","tensor","."]
code: def build(self, input_shape):
      """Initialization for variables in AttLayer2
      There are there variables in AttLayer2, i.e. W, b and q.
  
      Args:
          input_shape (object): shape of input tensor.
      """
  
      assert len(input_shape) == 3
      dim = self.dim
      self.W = self.add_weight(
          name="W",
          shape=(int(input_shape[-1]), dim),
          initializer=keras.initializers.glorot_uniform(seed=self.seed),
          trainable=True,
      )
      self.b = self.add_weight(
          name="b",
          shape=(dim,),
          initializer=keras.initializers.Zeros(),
          trainable=True,
      )
      self.q = self.add_weight(
          name="q",
          shape=(dim, 1),
          initializer=keras.initializers.glorot_uniform(seed=self.seed),
          trainable=True,
      )
      super(AttLayer2, self).build(input_shape)
  
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 2 for calling the AttLayer2 obj's underlying member method code with example usage: obj.build(input_shape) without return types