f-dangel / unfoldNd

(N=1,2,3)-dimensional unfold (im2col) and fold (col2im) in PyTorch
MIT License
84 stars 6 forks source link

Create package API #2

Closed f-dangel closed 3 years ago

f-dangel commented 3 years ago

This package provides three classes that inherit from torch.nn.Module:

All three functions have the same interface as torch.nn.Unfold.

Internally, they call out to a function _unfoldNd which uses a one-hot convolution to perform the unfold operation.