Imported from https://github.com/feichtenhofer/twostreamfusion