You could create a list for both statistics and append them for each iteration or epoch.
Also, make sure to detach the tensors before storing them in the list (tensor.detach() or tensor,item()). Otherwise you could store the whole computation graph, which will increase the memory usage.