Can you show me an example to use checkpoint in libtorch?

Hi, I am trying to optimize an tensor network written in libtorch. I found that it used much memory. I checked that in pytorch one may use torch.utils.checkpoint to reduce the memory usage. Do you know how to use it in libtorch?