Imported from https://github.com/ignacio-rocco/cnngeometric_pytorch