In previous versions nn.MaxPool2d was used before the flattening of the activation (as seen here), which restricts the input shapes to the original shape, which is [batch_size, 3, 224, 224].
Adaptive pooling layers output an activation with a specified size, so that you can now use inputs with a smaller or bigger spatial size, and the adaptive pooling layer will make sure, the output activation before the flattening has the desired shape.
This is necessary as linear layers have a fixed number in input features, which your flattened activation has to match.