Fix cifar10 format

Fix bug reported by Xiao Da about performance loss on cifar10, traced back to a misconversion from design matrix to conv2d space.
Added unit test and integration test.