Example of training mnist in tensorflow eager mode.
I modified the code from mnist_eager and 07_convolutional_neural_networks_for_emotion_recognition.
When eagerFlag is 0, do not use eager mode, and do not add tfe.enable_eager_execution(), otherwise the code can not run.
When eagerFlag is 1 or 2, we use different ways of eager mode.