Imported from https://github.com/Cyril-Sterling/EVFlowNet-pytorch