Interesting RowPitch is used here. I wonder whether we have to actually expect the underlying representation to not be contiguous. If not this would be one memcpy. I couldn't really find anything with a quick google.