I’m not quite sure, how the xxx_losses are calculated.
From your model definition it looks like you’ve embedded the losses directly in the model, but I’m not sure where the variables come from.
Also as a quick side note: you should call your model directly (model(input)) to perform the forward pass instead of model.forward(input) as this will make sure all hooks are properly handled.