Imported from https://github.com/pl8787/MatchPyramid-TensorFlow