(self, x, batch_size)
return tf.transpose(x, perm=[0, 2, 1, 3])
Split the last dimension into (num_heads, depth).

        Transpose the result such that the shape is (batch_size, num_heads, seq_len, depth)
Split the last dimension into (num_heads, depth).
Split the last dimension into ( num_heads depth ) .
def split_heads(self, x, batch_size):
    """Split the last dimension into (num_heads, depth).

        Transpose the result such that the shape is (batch_size, num_heads, seq_len, depth)
        """
    x = tf.reshape(x, (batch_size, -1, self.num_heads, self.depth))
    return tf.transpose(x, perm=[0, 2, 1, 3])
def split_heads ( self , x , batch_size ) : x = tf . reshape ( x , ( batch_size , - 1 , self . num_heads , self . depth ) ) return tf . transpose ( x , perm = [ 0 , 2 , 1 , 3 ] )