src/transformers/models/deit/modeling_tf_deit.py/TFDeiTForMaskedImageModeling/serving_output
class TFDeiTForMaskedImageModeling:    def serving_output(self, output: TFMaskedLMOutput) -> TFMaskedLMOutput:
        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 TFMaskedLMOutput(logits=output.logits, hidden_states=hidden_states, attentions=attentions)