src/transformers/models/lilt/modeling_lilt.py/LiltSelfAttention/transpose_for_scores
class LiltSelfAttention:    def transpose_for_scores(self, x, r=1):
        new_x_shape = x.size()[:-1] + (self.num_attention_heads, self.attention_head_size // r)
        x = x.view(*new_x_shape)
        return x.permute(0, 2, 1, 3)