(self, x, batch_size)
return split_x
Split hidden_size into depth(hidden_size // num_heads) for
    multi-head attention.
    Args:
      x: (batch_size, seq_len_x, hidden_size)
      batch_size

    Returns:
      split_x: (batch_size, num_heads, seq_len_x, depth)
Split hidden_size into depth(hidden_size // num_heads) for
    multi-head attention.
    Args:
      x: (batch_size, seq_len_x, hidden_size)
      batch_size
Split hidden_size into depth ( hidden_size // num_heads ) for multi - head attention . Args : x : ( batch_size seq_len_x hidden_size ) batch_size
def split_heads(self, x, batch_size):
    """
    Split hidden_size into depth(hidden_size // num_heads) for
    multi-head attention.
    Args:
      x: (batch_size, seq_len_x, hidden_size)
      batch_size

    Returns:
      split_x: (batch_size, num_heads, seq_len_x, depth)
    """
    x = tf.reshape(x, (batch_size, -1, self.num_heads, self.depth))
    split_x = tf.transpose(x, perm=[0, 2, 1, 3])
    return split_x
def split_heads ( self , x , batch_size ) : x = tf . reshape ( x , ( batch_size , - 1 , self . num_heads , self . depth ) ) split_x = tf . transpose ( x , perm = [ 0 , 2 , 1 , 3 ] ) return split_x