torch.roll
- torch.roll(input, shifts, dims=None) → Tensor
Roll the tensor
inputalong the given dimension(s). Elements that are shifted beyond the last position are re-introduced at the first position. Ifis , the tensor will be flattened before rolling and then restored to the original shape.