MCPcopy Create free account
hub / github.com/SooLab/CGFormer / forward

Method forward

bert/modeling_bert.py:305–319  ·  view source on GitHub ↗
(
        self,
        hidden_states,
        attention_mask=None,
        head_mask=None,
        encoder_hidden_states=None,
        encoder_attention_mask=None,
        output_attentions=False,
    )

Source from the content-addressed store, hash-verified

303 self.pruned_heads = self.pruned_heads.union(heads)
304
305 def forward(
306 self,
307 hidden_states,
308 attention_mask=None,
309 head_mask=None,
310 encoder_hidden_states=None,
311 encoder_attention_mask=None,
312 output_attentions=False,
313 ):
314 self_outputs = self.self(
315 hidden_states, attention_mask, head_mask, encoder_hidden_states, encoder_attention_mask, output_attentions,
316 )
317 attention_output = self.output(self_outputs[0], hidden_states)
318 outputs = (attention_output,) + self_outputs[1:] # add attentions if we output them
319 return outputs
320
321
322class BertIntermediate(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected