nn.Flatten would use the default arguments:
start_dim=1, end_dim=-1

so the batch dimension (dim0) should stay the same while all additional dimensions would be flattened.
Based on the error message it seems you are trying to apply a 2D interpolation on this flattened tensor, which won’t work:
x = torch.randn(1, 3, 4, 4)
out = F.interpolate(x, size=(10, 10)) # works

y = x.view(x.size(0), -1)
out = F.interpolate(y, size=(10, 10)) # error
> ValueError: size shape must match input shape. Input is 0D, size is 2

out = F.interpolate(torch.nn.Flatten()(x), size=(10, 10)) # error
> ValueError: size shape must match input shape. Input is 0D, size is 2

since you would need to use a 3-, 4, or 5-dimensional tensor as given in the code snippet ([batch_size, channels, seq_len], [batch_size, channels, height, width], or [batch_size, channels, depth, height, width]).