tabensemb.model.AbstractNN.backward#
method
- AbstractNN.backward(loss: Tensor, optimizer: Steppable | None, optimizer_idx: int | None, *args: Any, **kwargs: Any) None#
Called to perform backward on the loss returned in
training_step(). Override this hook with your own implementation if you need to.- Parameters:
loss¶ – The loss tensor returned by
training_step(). If gradient accumulation is used, the loss here holds the normalized value (scaled by 1 / accumulation steps).optimizer¶ – Current optimizer being used.
Noneif using manual optimization.optimizer_idx¶ – Index of the current optimizer being used.
Noneif using manual optimization.
Example:
def backward(self, loss, optimizer, optimizer_idx): loss.backward()