The first view operation might interleave the values, so you should permute the channel dimension to the last dimension first:
x = torch.rand((b, c, x_in, y_in), requires_grad=False)
x = x.permute(0, 2, 3, 1).view(b*x_in*y_in, 6)

I’m not sure how the output is calculated, so it’s hard to tell, if the last view is working correctly.