Unable to understand dimension mismatch error

Great, so the shape and type of y look correct. x looks suspect though: you should have a 2d Array (Matrix) and not a matrix of matrices. The shape should be 1024x13439 (32*32 x batch size) to match your network. I would double check load_data and what it outputs to make sure this is happening, as the culprit is likely somewhere in the call stack of that function.