pub fn forward_t(
        &self,
        input_ids: Option<Tensor>,
        mask: Option<Tensor>,
        token_type_ids: Option<Tensor>,
        position_ids: Option<Tensor>,
        input_embeds: Option<Tensor>,
        train: bool,
    ) -> Tensor {
        match *self {
            Self::Bart(ref model) => {
                model
                    .forward_t(
                        &input_ids.expect("`input_ids` must be provided for BART models"),
                        mask.as_ref(),
                        None,
                        None,
                        None,
                        train,
                    )
                    .0
            }
            Self::Bert(ref model) => {
                model
                    .forward_t(
                        input_ids,
                        mask,
                        token_type_ids,
                        position_ids,
                        input_embeds,
                        train,
                    )
                    .0
            }
            Self::DistilBert(ref model) => {
                model
                    .forward_t(input_ids, mask, input_embeds, train)
                    .expect("Error in distilbert forward_t")
                    .0
            }
            Self::Roberta(ref model) | Self::XLMRoberta(ref model) => {
                model
                    .forward_t(
                        input_ids,
                        mask,
                        token_type_ids,
                        position_ids,
                        input_embeds,
                        train,
                    )
                    .0
            }
            Self::Albert(ref model) => {
                model
                    .forward_t(
                        input_ids,
                        mask,
                        token_type_ids,
                        position_ids,
                        input_embeds,
                        train,
                    )
                    .0
            }
        }
    }
/// 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>,
        token_type_ids: Option<Tensor>,
        position_ids: Option<Tensor>,
        input_embeds: Option<Tensor>,
        train: bool,
    ) -> Tensor {
        match *self {
            Self::Bart(ref model) => {
                model
                    .forward_t(
                        &input_ids.expect("`input_ids` must be provided for BART models"),
                        mask.as_ref(),
                        None,
                        None,
                        None,
                        train,
                    )
                    .0
            }
            Self::Bert(ref model) => {
                model
                    .forward_t(
                        input_ids,
                        mask,
                        token_type_ids,
                        position_ids,
                        input_embeds,
                        train,
                    )
                    .0
            }
            Self::DistilBert(ref model) => {
                model
                    .forward_t(input_ids, mask, input_embeds, train)
                    .expect("Error in distilbert forward_t")
                    .0
            }
            Self::Roberta(ref model) | Self::XLMRoberta(ref model) => {
                model
                    .forward_t(
                        input_ids,
                        mask,
                        token_type_ids,
                        position_ids,
                        input_embeds,
                        train,
                    )
                    .0
            }
            Self::Albert(ref model) => {
                model
                    .forward_t(
                        input_ids,
                        mask,
                        token_type_ids,
                        position_ids,
                        input_embeds,
                        train,
                    )
                    .0
            }
        }
    }
pub fn forward_t ( & self , input_ids : Option < Tensor > , mask : Option < Tensor > , token_type_ids : Option < Tensor > , position_ids : Option < Tensor > , input_embeds : Option < Tensor > , train : bool , ) -> Tensor { match * self { Self :: Bart ( ref model ) => { model . forward_t ( & input_ids . expect ( " " ) , mask . as_ref ( ) , None , None , None , train , ) . 0 } Self :: Bert ( ref model ) => { model . forward_t ( input_ids , mask , token_type_ids , position_ids , input_embeds , train , ) . 0 } Self :: DistilBert ( ref model ) => { model . forward_t ( input_ids , mask , input_embeds , train ) . expect ( " " ) . 0 } Self :: Roberta ( ref model ) | Self :: XLMRoberta ( ref model ) => { model . forward_t ( input_ids , mask , token_type_ids , position_ids , input_embeds , train , ) . 0 } Self :: Albert ( ref model ) => { model . forward_t ( input_ids , mask , token_type_ids , position_ids , input_embeds , train , ) . 0 } } }
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>
token_type_ids
Option<Tensor>
position_ids
Option<Tensor>
input_embeds
Option<Tensor>
train
bool
&self
input_ids
Option<Tensor>
mask
Option<Tensor>
token_type_ids
Option<Tensor>
position_ids
Option<Tensor>
input_embeds
Option<Tensor>
train
bool