/// Apply the attention block.
///
/// Outputs the hidden states and the attention probabilities.
Apply the attention block.
Outputs the hidden states and the attention probabilities.
Apply the attention block . Outputs the hidden states and the attention probabilities .
pub fn forward_t(
        &self,
        hidden_states: &Tensor,
        attention_mask: Option<&LogitsMask>,
        train: bool,
    ) -> (Tensor, Tensor) {
        let (self_outputs, attention_probs) =
            self.self_attention
                .forward_t(hidden_states, attention_mask, train);
        let attention_output = self
            .self_output
            .forward_t(&self_outputs, &hidden_states, train);
        (attention_output, attention_probs)
    }
pub fn forward_t ( & self , hidden_states : & Tensor , attention_mask : Option < & LogitsMask > , train : bool , ) -> ( Tensor , Tensor ) { let ( self_outputs , attention_probs ) = self . self_attention . forward_t ( hidden_states , attention_mask , train ) ; let attention_output = self . self_output . forward_t ( & self_outputs , & hidden_states , train ) ; ( attention_output , attention_probs ) }
Apply the attention block.
Apply the attention block .
&self
hidden_states
&Tensor
attention_mask
Option<&LogitsMask>
train
bool