Why we have to do reshaping in this numpy array

import tensorflow as tf
import numpy as np

(x_train, y_train), (x_test,y_test)= tf.keras.datasets.mnist.load_data()

x_train = x_train / np.float32(255)
y_train = y_train.astype(np.int64)

 # The `x` arrays are in uint8 and have values in the [0, 255] range.  # You need to convert them to float32 with values in the [0, 1] range.

why we have to convert it??