pytorch_generative/trainer.py
def train_one_batch(self, x, y):
        """Trains the model on a single batch of examples.

        Subclasses can override this method to define custom training loops.
        """
        preds = self._model(x)
        loss = self._loss_fn(x, y, preds)
        return loss
Trains the model on a single batch of examples.

        Subclasses can override this method to define custom training loops.
        
Trains the model on a single batch of examples.
Subclasses can override this method to define custom training loops.
Trains the model on a single batch of examples . Subclasses can override this method to define custom training loops .
def train_one_batch(self, x, y):
        preds = self._model(x)
        loss = self._loss_fn(x, y, preds)
        return loss
def train_one_batch ( self , x , y ) : preds = self . _model ( x ) loss = self . _loss_fn ( x , y , preds ) return loss
Trains the model on a single batch of examples.
Trains the model on a single batch of examples .
"""Trains the model on a single batch of examples.

        Subclasses can override this method to define custom training loops.
        """
self
x
y