Imported from https://github.com/cgtuebingen/Flex-Convolution