paddlenlp/transformers/distill_utils.py
def bert_forward(self, input_ids, token_type_ids=None, attention_mask=None):
    """
    Replaces `forward` function while using multi gpus to train.
    """
    assert hasattr(self, self.base_model_prefix), \
        "Student class should inherit from %s" % (self.base_model_class)
    model = getattr(self, self.base_model_prefix)
    encoder = model.encoder

    sequence_output, pooled_output = model(input_ids, token_type_ids,
                                           attention_mask)
    return encoder.attentions, encoder.hidden_states

    Replaces `forward` function while using multi gpus to train.
    
Replaces `forward` function while using multi gpus to train.
Replaces ` forward ` function while using multi gpus to train .
def bert_forward(self, input_ids, token_type_ids=None, attention_mask=None):
    assert hasattr(self, self.base_model_prefix), \
        "Student class should inherit from %s" % (self.base_model_class)
    model = getattr(self, self.base_model_prefix)
    encoder = model.encoder
    sequence_output, pooled_output = model(input_ids, token_type_ids,
                                           attention_mask)
    return encoder.attentions, encoder.hidden_states
def bert_forward ( self , input_ids , token_type_ids = None , attention_mask = None ) : assert hasattr ( self , self . base_model_prefix ) , "Student class should inherit from %s" % ( self . base_model_class ) model = getattr ( self , self . base_model_prefix ) encoder = model . encoder sequence_output , pooled_output = model ( input_ids , token_type_ids , attention_mask ) return encoder . attentions , encoder . hidden_states
Replaces `forward` function while using multi gpus to train.
Replaces ` forward ` function while using multi gpus to train .
"""
    Replaces `forward` function while using multi gpus to train.
    """
self
input_ids
token_type_ids
attention_mask