You can in some cases yes, but it won’t be the most easy-to-read code:
import torch

a = torch.rand(40)

print(a)

size_slices = 20
size_overlap = 10
nb_slices = 3
b = a.as_strided((nb_slices, size_slices), (size_slices-size_overlap, 1), 0)
print(b)

print(b.sum(0))