Collect all  losses into a list?
What's the easiest way to return a list with all my losses in it? Note: I don't want to log it, but I want to have a list that I can plot in altair after training is done.
Currently, I'm maintaining a list outside the lightning module:
losses = [] # <-- this one
...

class MyModule(LightningModule):
    def validation_epoch_end(self, outputs):
            avg_loss = torch.stack([ x['val_loss'] for x in outputs ]).mean()
            correct = sum([ x['correct'] for x in outputs])
            accuracy = float(correct) / len(outputs)
            losses.append(avg_loss)   # <--- append to outside var here
            
            return {'avg_loss' : avg_loss, 'accuracy': accuracy, 'log' : {'val_loss': avg_loss, 'accuracy': accuracy}}

Is there a "lightning" way of doing this?