class_docstr: Multi-head self attention implement.
  
  Args:
      multiheads (int): The number of heads.
      head_dim (object): Dimention of each head.
      mask_right (boolean): whether to mask right words.
  
  Returns:
      object: Weighted sum after attention.
docstr: Initialization for variables in SelfAttention.
  There are three variables in SelfAttention, i.e. WQ, WK ans WV.
  WQ is used for linear transformation of query.
  WK is used for linear transformation of key.
  WV is used for linear transformation of value.
  
  Args:
      input_shape (object): shape of input tensor.
docstr_tok: ["Initialization","for","variables","in","SelfAttention",".","There","are","three","variables","in","SelfAttention",",","i.e",".","WQ",",","WK","ans","WV",".","WQ","is","used","for","linear","transformation","of","query",".","WK","is","used","for","linear","transformation","of","key",".","WV","is","used","for","linear","transformation","of","value",".","Args",":","input_shape","(","object",")",":","shape","of","input","tensor","."]
code: def build(self, input_shape):
      """Initialization for variables in SelfAttention.
      There are three variables in SelfAttention, i.e. WQ, WK ans WV.
      WQ is used for linear transformation of query.
      WK is used for linear transformation of key.
      WV is used for linear transformation of value.
  
      Args:
          input_shape (object): shape of input tensor.
      """
  
      self.WQ = self.add_weight(
          name="WQ",
          shape=(int(input_shape[0][-1]), self.output_dim),
          initializer=keras.initializers.glorot_uniform(seed=self.seed),
          trainable=True,
      )
      self.WK = self.add_weight(
          name="WK",
          shape=(int(input_shape[1][-1]), self.output_dim),
          initializer=keras.initializers.glorot_uniform(seed=self.seed),
          trainable=True,
      )
      self.WV = self.add_weight(
          name="WV",
          shape=(int(input_shape[2][-1]), self.output_dim),
          initializer=keras.initializers.glorot_uniform(seed=self.seed),
          trainable=True,
      )
      super(SelfAttention, 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 3 for calling the SelfAttention obj's underlying member method code with example usage: obj.build(input_shape) without return types