Implementing fast dense feature extraction in PyTorch
I am trying to implement this paper in PyTorch Fast Dense Feature Extractor but I am having trouble converting the Torch implementation example they provide into PyTorch. 

My attempt thus far has the issue that when adding an additional dimension to the feature map then the convolutional weights don't match the feature shape. How is this managed in Torch (from their implementation it seem that Torch doesn't care about this, but PyTorch does). My code: https://gist.github.com/system123/c4b8ef3824f2230f181f8cfba84f0cfd

Any other solutions to this problem would be great too. Basically, I have a feature extractor that converts a 128x128 patch into an embedding and I'd like to apply this in a dense manner across a larger image without using a for loop to evaluate the CNN on each location as that has a lot of duplicate computation.

It is your lucky day as I have recently uploaded a PyTorch and TF implementation of the paper Fast Dense Feature Extraction with CNNs with Pooling Layers.

An approach to compute patch-based local feature descriptors efficiently in presence of pooling and striding layers for whole images at once.

See https://github.com/erezposner/Fast_Dense_Feature_Extraction for details.

It contains simple instructions that will explain how to use the Fast Dense Feature Extraction (FDFE) project.

Good luck
