Imported from https://github.com/cvtower/SeesawNet-pytorch-reimplement