RuntimeError: set_sizes_and_strides is not allowed on a Tensor created from .data or .detach(). when using Gradient checkpointing

Could you post a minimal executable code snippet so that we can check where this issue is triggered, please?