Imported from https://github.com/jingli9111/EUNN-tensorflow