Last night, after a lot of try and error I got nn.Unfold to work, what I had to do was now that I had a tensor with shape (64,182, 178) I transposed it to (64, 178, 182) and now i can use nn.Fold(my_tensor, output_size=(1 ,16198), kernel_size=(1, 178) stride=(1, 89)) to get back a tensor with the original size of (1, 16198) with the overlapping sections added, completing the overlap and add algirithm, sorry that i said my original tensor was shaped (1, 16308) when it is actually (1, 16198). Still not very sure of how nn.Fold works though.