Torch grid_sample with 'wrap' padding mode

Hello, I am trying to port my code from TensorFlow to PyTorch.
I was using tfa.image.transform for transforming my image based on the given transformation matrix and found that torch.nn.functional.grid_sample is the equivalent function.

However, in my previous code, I use wrap mode for filling the outside boundary.
As a review, wrap mode will extend the input by wrapping around to the opposite edge (a b c d | a b c d | a b c d).

And on the PyTorch grid_sample, I can only find the supported padding_mode for zeros, and border. and reflection.

Is there any alternative for implementing the wrap padding mode?

Thank you