def cnn_data(data): x, y = data.shape[1:] return data.reshape((-1, x, y, 1))
We introduce this function used in the following code.
In this line of code x and y are two values while data.shape is producing only one value:
x
y
data.shape
x, y = data.shape[1:]