Yes, I read up the documentation, you are right:
    By definition of collate function in DataLoader, it is mentioned in documentation that it prepends an extra dimension to the tensor as batch_size. Thus,
    if the input y is a tensor of shape [1,], then .view(-1, 1) will change the shape to [1, 1], and when we collate using DataLoader, say with batch_size = 4,
    then the collated y will be a tensor of shape [4, 1, 1] instead of [4, 1] since it prepends an extra dimension.