src/transformers/models/beit/modeling_beit.py/BeitAttention/forward
class BeitAttention:    def forward(self, hidden_states, head_mask=None, output_attentions=False, relative_position_bias=None):
        self_outputs = self.attention(hidden_states, head_mask, output_attentions, relative_position_bias)

        attention_output = self.output(self_outputs[0], hidden_states)

        outputs = (attention_output,) + self_outputs[1:]  # add attentions if we output them
        return outputs