Solved by ptrblck in post #12 
              
              
                You could return the tensors or numpy arrays containing the loss values from the train and test functions and plot it in a single plt.plot in the main script.