Pytorch tensor.unfold

Yes, a nested loop could create a large overhead compared to a single operation.