Thanks for the clarification.
Does unfold create a copy of the original array? If so I don’t think I will be able to use it due to my limited memory. My aim is to evaluate some module/model on an input array in a sliding window fashion. I could do this with a loop, then concatenate at the end. For example:
suboutputs = []
for i in range(x_length - window_length):
  suboutputs.append(model(x[i:i+window_length])
output = torch.cat(suboutputs)  # creates a copy

Is there a way to avoid the concatenation?