Assuming you have the RGP in the numpy array and the shape of of your array with thousands of pictures with 32*32 Pixels is (50000,32,32,3), then you can create gray scale by average of RGB
(50000,32,32,3)
X_gray = np.sum(X_color/3, axis=3, keepdims=True)