I feel unsafe about this function - it is creating strange strides. As a rule of thumb, caffe always uses contiguous memory chunks without striding. This may be a little handicapped but seems to work the best without the need of dealing with multiple striding issues.