nlpmodels/utils/train.py
def _calc_loss_function(self, y_hat: Any, data: Any):
        """
        A wrapper function for calling the loss calculation.
        """
        return self._loss_function(y_hat.view(-1, y_hat.size(-1)), data.tgt.view(-1))

        A wrapper function for calling the loss calculation.
        
A wrapper function for calling the loss calculation.
A wrapper function for calling the loss calculation .
def _calc_loss_function(self, y_hat: Any, data: Any):
        return self._loss_function(y_hat.view(-1, y_hat.size(-1)), data.tgt.view(-1))
def _calc_loss_function ( self , y_hat : Any , data : Any ) : return self . _loss_function ( y_hat . view ( - 1 , y_hat . size ( - 1 ) ) , data . tgt . view ( - 1 ) )
A wrapper function for calling the loss calculation.
A wrapper function for calling the loss calculation .
"""
        A wrapper function for calling the loss calculation.
        """
self
y_hat
Any
data
Any