final rstm_v5 with checkpointing