When I have a tensor “x” (size: T), I want to get a tensor “dist” (size: (D, T)) like the following. (D < T)
dist = torch.tensor(
    [
        [x[0], x[1], x[2], ..., x[T-1]],
        [x[-1], x[0], x[1], ...,x[T-2]],
        [x[-2], x[-1], x[0], ...,x[T-3]],
        ...
        [x[-D], x[1-D], x[2-D], ..., x[T-D]]
    ]
)

What is the best way to do this?
Thank you!