Hi,
The view operation will just change the view you look at the memory.
A contiguous Tensor is stored in a row major way, meaning that the rows contain elements that are next to each other in memory.
When you do view, you just read these with different size, still with rows containing elements that are next to each other in memory.
In general, view are often used to collapse and uncollapse dimensions.
In particular, if you want to work with a 1D Tensor in your case, you can do b.view(3*2*2). Then work with this 1D Tensor and finally do res.view(2, 6) to get back to the original shape.