src/transformers/models/deit/modeling_tf_deit.py/TFDeiTForImageClassificationWithTeacher/serving_output
class TFDeiTForImageClassificationWithTeacher:    def serving_output(
        self, output: TFDeiTForImageClassificationWithTeacherOutput
    ) -> TFDeiTForImageClassificationWithTeacherOutput:
        hidden_states = tf.convert_to_tensor(output.hidden_states) if self.config.output_hidden_states else None
        attentions = tf.convert_to_tensor(output.attentions) if self.config.output_attentions else None

        return TFDeiTForImageClassificationWithTeacherOutput(
            logits=output.logits,
            cls_logits=output.cls_logits,
            distillation_logits=output.distillation_logits,
            hidden_states=hidden_states,
            attentions=attentions,
        )