Pytorch equivalent of numpy.as_strided

What is the pytorch equivalent of numpy.lib.stride_tricks.as_strided? I’m wanting to convert a tensor to another view of the tensor, possibly with repeated entries.

If you want repeated entries, would x.expand work for you?

Best regards

Thomas