In your code example it looks like you want to use the current batch sequentially on all your models.
This would mean that loss gets overwritten for each new model, so you don’t need to store it somehow.