Overlap and add tensor in pytorch using nn.fold
I have the following problem, I have tensor with shape (1,16198), first i would like to dive it into chunks so I used unfold like:
my_tensor.unfold(-1, 178, 89) -&gt; tensor with shape (1, 182, 178) 

which means 182 overlapping chunks of size 178, that's perfect.
But now I would like to undo the operation adding the overlapping chunks and get back a (1,16198) tensor. I believe that the fold method would do that, but I've burned through several hours trying to understand how it works to no progress at all and I cant seem to find a good explanation source for how to use it and I am afraid the official documentation is way to complex for my understanding.

Got it to work last night, i had to transpose to the (1, 182, 178) tensor to (1, 178, 182) then I used
nn.Fold(my_tensor, (1, 16198), kernel_size=(1,178), stride=(1,89)) 

and i get
back my tensor with overlapping sections added, thus completing the overlap and add algorithm, still not sure how nn.Fold works.
