src/transformers/models/mobilebert/modeling_tf_mobilebert.py/TFMobileBertForPreTraining/serving_output
class TFMobileBertForPreTraining:    def serving_output(self, output):
        hs = tf.convert_to_tensor(output.hidden_states) if self.config.output_hidden_states else None
        attns = tf.convert_to_tensor(output.attentions) if self.config.output_attentions else None

        return TFMobileBertForPreTrainingOutput(
            prediction_logits=output.prediction_logits,
            seq_relationship_logits=output.seq_relationship_logits,
            hidden_states=hs,
            attentions=attns,
        )