You could use the flatten operation 1 of tensors!
input = torch.ones((1,3,100,100))
flat_input = input.flatten(input, start_dim=1)

Keep an eye on the start_dim parameter, so you keep the number of batches.