# Preprocess the data x_train = x_train.reshape(-1, 784).astype('float32') / 127.5 - 1.0
You see the actual implementation.