How to resize MNIST images to fit AlexNet model
You can use tf.image.resize, as follows:
(x_train, y_train), (_, _) = tf.keras.datasets.mnist.load_data()

print(x_trian.shape) # (60000, 28, 28)

# train set / data 
x_train = np.expand_dims(x_train, axis=-1)
x_train = tf.image.resize(x_train, [32,32]) # if we want to resize 

print(x_train.shape) # (60000, 32, 32, 1)