A utility decorator to checkpoint intermediate computations in a program.