def forward(self, hidden_states):
    attn_weights = []
    for layer_block in self.layer:
        (hidden_states, weights) = layer_block(hidden_states)
        if self.vis:
            attn_weights.append(weights)
    encoded = self.encoder_norm(hidden_states)
    return (encoded, attn_weights)
def forward(self, hidden_states):
    attn_weights = []
    for layer_block in self.layer:
        (hidden_states, weights) = layer_block(hidden_states)
        if self.vis:
            attn_weights.append(weights)
    encoded = self.encoder_norm(hidden_states)
    return (encoded, attn_weights)