Imported from https://github.com/tensorflow/models/tree/master/research/attention_ocr