pub fn forward_t(
        &self,
        input_ids: Option<Tensor>,
        mask: Option<Tensor>,
        input_embeds: Option<Tensor>,
        train: bool,
    ) -> (Tensor, Tensor) {
        match *self {
            Self::Bert(ref model) => {
                let outputs = model.forward_t(input_ids, mask, None, None, input_embeds, train);
                (outputs.0, outputs.1)
            }
            Self::DistilBert(ref model) => {
                let outputs = model
                    .forward_t(input_ids, mask, input_embeds, train)
                    .expect("Error in distilbert forward_t");
                (outputs.0, outputs.1)
            }
            Self::Roberta(ref model) | Self::XLMRoberta(ref model) => {
                let outputs = model.forward_t(input_ids, mask, None, None, input_embeds, train);
                (outputs.0, outputs.1)
            }
            Self::Albert(ref model) => {
                let outputs = model.forward_t(input_ids, mask, None, None, input_embeds, train);
                (outputs.0, outputs.1)
            }
        }
    }
/// Interface method to forward_t() of the particular models.
Interface method to forward_t() of the particular models.
Interface method to forward_t () of the particular models .
pub fn forward_t(
        &self,
        input_ids: Option<Tensor>,
        mask: Option<Tensor>,
        input_embeds: Option<Tensor>,
        train: bool,
    ) -> (Tensor, Tensor) {
        match *self {
            Self::Bert(ref model) => {
                let outputs = model.forward_t(input_ids, mask, None, None, input_embeds, train);
                (outputs.0, outputs.1)
            }
            Self::DistilBert(ref model) => {
                let outputs = model
                    .forward_t(input_ids, mask, input_embeds, train)
                    .expect("Error in distilbert forward_t");
                (outputs.0, outputs.1)
            }
            Self::Roberta(ref model) | Self::XLMRoberta(ref model) => {
                let outputs = model.forward_t(input_ids, mask, None, None, input_embeds, train);
                (outputs.0, outputs.1)
            }
            Self::Albert(ref model) => {
                let outputs = model.forward_t(input_ids, mask, None, None, input_embeds, train);
                (outputs.0, outputs.1)
            }
        }
    }
pub fn forward_t ( & self , input_ids : Option < Tensor > , mask : Option < Tensor > , input_embeds : Option < Tensor > , train : bool , ) -> ( Tensor , Tensor ) { match * self { Self :: Bert ( ref model ) => { let outputs = model . forward_t ( input_ids , mask , None , None , input_embeds , train ) ; ( outputs . 0 , outputs . 1 ) } Self :: DistilBert ( ref model ) => { let outputs = model . forward_t ( input_ids , mask , input_embeds , train ) . expect ( " " ) ; ( outputs . 0 , outputs . 1 ) } Self :: Roberta ( ref model ) | Self :: XLMRoberta ( ref model ) => { let outputs = model . forward_t ( input_ids , mask , None , None , input_embeds , train ) ; ( outputs . 0 , outputs . 1 ) } Self :: Albert ( ref model ) => { let outputs = model . forward_t ( input_ids , mask , None , None , input_embeds , train ) ; ( outputs . 0 , outputs . 1 ) } } }
Interface method to forward_t() of the particular models.
Interface method to forward_t () of the particular models .
&self
input_ids
Option<Tensor>
mask
Option<Tensor>
input_embeds
Option<Tensor>
train
bool
&self
input_ids
Option<Tensor>
mask
Option<Tensor>
input_embeds
Option<Tensor>
train
bool