Imported from https://github.com/philipperemy/tensorflow-phased-lstm