class_docstr:  Multi-headed attention is based on "Attention
  is all you Need" (https://arxiv.org/pdf/1706.03762.pdf).
class_docstr_tok: ["Multi-headed","attention","is","based","on","``","Attention","is","all","you","Need","''","(","https",":","\/\/arxiv.org\/pdf\/1706.03762.pdf",")","."]
code: def __init__(self, hidden_size, num_heads, **kwargs):
      super().__init__(**kwargs)
      self.hidden_size, self.num_heads = hidden_size, num_heads
      assert self.hidden_size % self.num_heads == 0
  
      self.depth = self.hidden_size // self.num_heads
  
      self.wq = tf.keras.layers.Dense(self.hidden_size)
      self.wk = tf.keras.layers.Dense(self.hidden_size)
      self.wv = tf.keras.layers.Dense(self.hidden_size)
  
      self.dense = tf.keras.layers.Dense(self.hidden_size)
  
file_path: delta/delta/layers/sub_tf.py
imports: from absl import logging
  import delta.compat
  import numpy
  from delta.layers.base_layer import Layer
  from delta.layers.utils_tf import shape_list
label_desc: Use image node_id 1 to create a new MultiHeadAttention object from inherited base classes: Layer with example: obj = MultiHeadAttention(hidden_size, num_heads)