First of all, thank you @lewtun  for all your input, you have been helping me loads the past few days and I am really grateful! This forum is amazing.
Just one thing, I am not too sure about what’s in the return, because the loss and the output are there
Would it be
return (loss(logits, labels), outputs) if return_output else loss

or we don’t need to call the logits and labels into loss, like what you did?