Thank you for your response! I actually tried using checkpoints before making this post, but I don’t think I’m using them properly. I tried putting logL and its arguments inside of  checkpoint.checkpoint() only to get an error saying  “Element 0 of tensors does not require grad and does not have a grad_fn”. Where should I be putting these checkpoints? Could you give me an example of how I might implement checkpoints in my code? If I could get one working example, I’m sure I could fiddle around with it on my own to figure out the right balance between memory and compute.