T5 user defined loss function

Yes, you are right about the _step method. And .generate can’t be called on self because here self is an instance of the LightningModule .