src/transformers/models/prophetnet/modeling_prophetnet.py/ProphetNetNgramSelfAttention/_shape
class ProphetNetNgramSelfAttention:    def _shape(self, tensor, seq_len, batch_size):
        return tensor.view(batch_size, seq_len, self.num_attn_heads, self.head_dim).transpose(1, 2).contiguous()